fakevim: fix 'O' at begin of document

'O' would have opened the new line after the first line instead of before

Merge-request: 96
Reviewed-by: hjk <qtc-committer@nokia.com>
This commit is contained in:
Martin Aumüller
2010-01-05 18:42:24 +01:00
committed by hjk
parent 22c700a4f6
commit 6ebac9116f

View File

@@ -1497,9 +1497,12 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
m_beginEditBlock = false; m_beginEditBlock = false;
moveToFirstNonBlankOnLine(); moveToFirstNonBlankOnLine();
if (key == 'O') if (key == 'O')
moveUp(); moveToStartOfLine();
moveToEndOfLine(); else
moveToEndOfLine();
m_tc.insertText("\n"); m_tc.insertText("\n");
if (key == 'O')
moveUp();
insertAutomaticIndentation(key == 'o'); insertAutomaticIndentation(key == 'o');
endEditBlock(); endEditBlock();
} else if (key == control('o')) { } else if (key == control('o')) {