From cfbda92f677b09bf4c90f531863750219c3a3ef3 Mon Sep 17 00:00:00 2001 From: Le Tan Date: Sat, 2 Dec 2017 21:27:20 +0800 Subject: [PATCH] vim-mode: amend the cursor position after executing a command --- src/utils/vvim.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/utils/vvim.cpp b/src/utils/vvim.cpp index 554c7928..fc421c53 100644 --- a/src/utils/vvim.cpp +++ b/src/utils/vvim.cpp @@ -2196,6 +2196,8 @@ bool VVim::handleKeyPressEvent(int key, int modifiers, int *p_autoIndentPos) clear_accept: resetState(); + amendCursorPosition(); + if (m_insertModeAfterCommand && !checkMode(VimMode::Visual) && !checkMode(VimMode::VisualLine)) { @@ -5920,7 +5922,6 @@ void VVim::amendCursorPosition() // Normal mode and cursor at the end of a non-empty block. cursor.movePosition(QTextCursor::PreviousCharacter); m_editor->setTextCursorW(cursor); - qDebug() << "vvim alter the cursor position one character left"; } } }