FakeVim: Properly replay macro with command line

Change-Id: I40617a1f6d28052e3593c186afb6db1d14222076
Reviewed-by: hjk <hjk121@nokiamail.com>
This commit is contained in:
Lukas Holecek
2014-10-26 07:38:27 +01:00
committed by hjk
parent 3ebdcdc7bf
commit de33b3affa
2 changed files with 24 additions and 1 deletions

View File

@@ -1856,6 +1856,7 @@ public:
Q_SLOT void onContentsChanged(int position, int charsRemoved, int charsAdded);
Q_SLOT void onUndoCommandAdded();
bool isCommandLineMode() const { return g.mode == ExMode || g.subsubmode == SearchSubSubMode; }
bool isInsertMode() const { return g.mode == InsertMode || g.mode == ReplaceMode; }
// Waiting for movement operator.
bool isOperatorPending() const {
@@ -2283,7 +2284,7 @@ void FakeVimHandler::Private::focus()
commitCursor();
}
bool exitCommandLine = (g.subsubmode == SearchSubSubMode || g.mode == ExMode);
bool exitCommandLine = isCommandLineMode();
resetCommandMode();
if (exitCommandLine)
updateMiniBuffer();
@@ -7892,6 +7893,9 @@ void FakeVimHandler::Private::enterVisualInsertMode(QChar command)
void FakeVimHandler::Private::enterCommandMode(Mode returnToMode)
{
if (g.isRecording && isCommandLineMode())
record(Input(Key_Escape, NoModifier));
if (isNoVisualMode() && atEndOfLine())
moveLeft();
g.mode = CommandMode;