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

Was seemingly broken by the target columns changes. Autotest is added
now, too.
This commit is contained in:
hjk
2009-04-29 15:29:03 +02:00
parent 0428a109e8
commit df2c805c73
2 changed files with 7 additions and 1 deletions

View File

@@ -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();

View File

@@ -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()