Fix dot command for pasting with 'P' being 'p'

Change-Id: Ic491f3a198a03fd08a680e044c4e8f2f5ebe2866
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Tom Praschan
2021-02-20 19:26:20 +01:00
parent cc0fa86ffd
commit f600386732
2 changed files with 3 additions and 1 deletions

View File

@@ -2534,6 +2534,8 @@ void FakeVimPlugin::test_vim_copy_paste()
KEYS("yy", "abc" N "abc" N X "def" N "ghi"); KEYS("yy", "abc" N "abc" N X "def" N "ghi");
KEYS("\"xp", "abc" N "abc" N "def" N X "abc" N "ghi"); KEYS("\"xp", "abc" N "abc" N "def" N X "abc" N "ghi");
KEYS(".", "abc" N "abc" N "def" N "abc" N X "abc" N "ghi"); KEYS(".", "abc" N "abc" N "def" N "abc" N X "abc" N "ghi");
KEYS("\"xP", "abc" N "abc" N "def" N "abc" N X "abc" N "abc" N "ghi");
KEYS(".", "abc" N "abc" N "def" N "abc" N X "abc" N "abc" N "abc" N "ghi");
// delete to black hole register // delete to black hole register
data.setText("aaa bbb ccc"); data.setText("aaa bbb ccc");

View File

@@ -4700,7 +4700,7 @@ bool FakeVimHandler::Private::handleNoSubMode(const Input &input)
} else if (input.isControl('o')) { } else if (input.isControl('o')) {
jump(-count()); jump(-count());
} else if (input.is('p') || input.is('P') || input.isShift(Qt::Key_Insert)) { } else if (input.is('p') || input.is('P') || input.isShift(Qt::Key_Insert)) {
dotCommand = QString("\"%1%2p").arg(QChar(m_register)).arg(count()); dotCommand = QString("\"%1%2%3").arg(QChar(m_register)).arg(count()).arg(input.asChar());
pasteText(!input.is('P')); pasteText(!input.is('P'));
setTargetColumn(); setTargetColumn();