Commit 06140f9c authored by hjk's avatar hjk

fakevim: fix 'ddp'

Was broken recently during the yank/paste rework.
parent ec2b2330
......@@ -954,12 +954,15 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
setDotCommand("%1cc", count());
finishMovement();
} else if (m_submode == DeleteSubMode && key == 'd') { // tested
moveToStartOfLine();
setTargetColumn();
setAnchor();
moveDown(count());
m_movetype = MoveLineWise;
int endPos = firstPositionInLine(lineForPosition(position()) + count() - 1);
Range range(position(), endPos, RangeLineMode);
yankText(range);
removeText(range);
setDotCommand("%1dd", count());
m_submode = NoSubMode;
moveToFirstNonBlankOnLine();
setTargetColumn();
finishMovement();
} else if (m_submode == YankSubMode && key == 'y') {
m_movetype = MoveLineWise;
......
......@@ -58,6 +58,7 @@ private slots:
// command mode
void command_cc();
void command_dd();
void command_dd_2();
void command_dollar();
void command_down();
void command_dfx_down();
......@@ -277,13 +278,23 @@ void tst_FakeVim::command_dd()
move("j", "@" + l[1]);
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("3dd", l[0] + "\n @QApplication app(argc, argv);\n" + lmid(7));
check("4l", 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(".", l[0] + "\n @return app.exec();\n" + lmid(9));
check("dd", l[0] + "\n@" + lmid(9));
}
void tst_FakeVim::command_dd_2()
{
setup();
move("j", "@" + l[1]);
check("dd", l[0] + "\n@" + lmid(2));
check("p", l[0] + "\n" + l[2] + "\n@" + l[1] + "\n" + lmid(3));
return; // FIXME
check("u", l[0] + "\n@" + lmid(2));
}
void tst_FakeVim::command_dollar()
{
setup();
......
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