fakevim: make 'o' undo work in a single operation

This commit is contained in:
hjk
2009-08-18 11:32:11 +02:00
parent 39e1113707
commit eb42239499

View File

@@ -1406,6 +1406,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
search(lastSearchString(), !m_lastSearchForward); search(lastSearchString(), !m_lastSearchForward);
recordJump(); recordJump();
} else if (key == 'o' || key == 'O') { } else if (key == 'o' || key == 'O') {
beginEditBlock();
setDotCommand("%1o", count()); setDotCommand("%1o", count());
enterInsertMode(); enterInsertMode();
moveToFirstNonBlankOnLine(); moveToFirstNonBlankOnLine();
@@ -1414,6 +1415,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
moveToEndOfLine(); moveToEndOfLine();
m_tc.insertText("\n"); m_tc.insertText("\n");
insertAutomaticIndentation(key == 'o'); insertAutomaticIndentation(key == 'o');
endEditBlock();
} else if (key == control('o')) { } else if (key == control('o')) {
if (!m_jumpListUndo.isEmpty()) { if (!m_jumpListUndo.isEmpty()) {
m_jumpListRedo.append(cursorPosition()); m_jumpListRedo.append(cursorPosition());