diff --git a/src/plugins/fakevim/fakevimhandler.cpp b/src/plugins/fakevim/fakevimhandler.cpp index 3b981fa6a23026dfdc2e19710752c3ad7f5afcd3..8a164fee4d5ba57416b5e1b8935cfdd67a8c1862 100644 --- a/src/plugins/fakevim/fakevimhandler.cpp +++ b/src/plugins/fakevim/fakevimhandler.cpp @@ -908,11 +908,13 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, moveToFirstNonBlankOnLine(); finishMovement(); } else if (key == 'i') { + recordBeginGroup(); enterInsertMode(); updateMiniBuffer(); if (atEndOfLine()) moveLeft(); } else if (key == 'I') { + recordBeginGroup(); setAnchor(); enterInsertMode(); if (m_gflag) @@ -976,13 +978,13 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, } else if (key == 'N') { search(lastSearchString(), !m_lastSearchForward); } else if (key == 'o' || key == 'O') { + recordBeginGroup(); + recordMove(); enterInsertMode(); moveToFirstNonBlankOnLine(); - recordBeginGroup(); int numSpaces = leftDist(); - moveUp(); - if (key == 'o') - moveDown(); + if (key == 'O') + moveUp(); moveToEndOfLine(); recordInsertText("\n"); moveToStartOfLine(); @@ -990,7 +992,6 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, recordInsertText(QString(indentDist(), ' ')); else recordInsertText(QString(numSpaces, ' ')); - recordEndGroup(); } else if (key == 'p' || key == 'P') { recordBeginGroup(); QString text = m_registers[m_register]; @@ -1034,8 +1035,13 @@ bool FakeVimHandler::Private::handleCommandMode(int key, int unmodified, redo(); } else if (key == 's') { recordBeginGroup(); - m_submode = ChangeSubMode; + setAnchor(); moveRight(qMin(count(), rightDist())); + m_registers[m_register] = recordRemoveSelectedText(); + //m_dotCommand = QString("%1s").arg(count()); + m_opcount.clear(); + m_mvcount.clear(); + enterInsertMode(); } else if (key == 't' || key == 'T') { m_subsubmode = FtSubSubMode; m_subsubdata = key; @@ -2043,7 +2049,6 @@ void FakeVimHandler::Private::enterInsertMode() EDITOR(setOverwriteMode(false)); m_mode = InsertMode; m_lastInsertion.clear(); - recordBeginGroup(); } void FakeVimHandler::Private::enterCommandMode()