Commit df2c805c authored by hjk's avatar hjk
Browse files

fakevim: fix 'dd' when cursor is not in the first column

Was seemingly broken by the target columns changes. Autotest is added
now, too.
parent 0428a109
......@@ -877,10 +877,12 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
finishMovement();
} else if (m_submode == DeleteSubMode && key == 'd') { // tested
moveToStartOfLine();
setTargetColumn();
setAnchor();
moveDown(count());
m_moveType = MoveLineWise;
finishMovement("d");
setDotCommand("%1dd", count());
finishMovement();
} else if (m_submode == YankSubMode && key == 'y') {
moveToStartOfLine();
setAnchor();
......
......@@ -265,6 +265,10 @@ void tst_FakeVim::command_dd()
check("dd", l[0] + "\n@" + lmid(2));
check(".", l[0] + "\n@" + lmid(3));
check("3dd", l[0] + "\n@" + lmid(6));
check("8l", l[0] + "\n QApp@lication app(argc, argv);\n" + lmid(7));
check("dd", l[0] + "\n@" + lmid(7));
check(".", l[0] + "\n@" + lmid(8));
check("dd", l[0] + "\n@" + lmid(9));
}
void tst_FakeVim::command_dollar()
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment