Commit db150ab6 authored by Martin Aumüller's avatar Martin Aumüller Committed by hjk
Browse files

fakevim: make sure that cursor is positioned before the character where text...


fakevim: make sure that cursor is positioned before the character where text would be inserted with 'i'

Merge-request: 113
Reviewed-by: default avatarhjk <qtc-committer@nokia.com>
parent 5af95f01
......@@ -650,6 +650,9 @@ EventResult FakeVimHandler::Private::handleEvent(QKeyEvent *ev)
Range range(m_oldPosition, m_tc.position());
m_lastInsertion.append(text(range));
}
} else if (!isVisualMode()) {
if (atEndOfLine())
moveLeft();
}
}
......@@ -3366,6 +3369,8 @@ void FakeVimHandler::Private::undo()
if (m_undoCursorPosition.contains(rev))
m_tc.setPosition(m_undoCursorPosition[rev]);
if (atEndOfLine())
moveLeft();
}
void FakeVimHandler::Private::redo()
......@@ -3398,6 +3403,8 @@ void FakeVimHandler::Private::enterCommandMode()
{
EDITOR(setCursorWidth(m_cursorWidth));
EDITOR(setOverwriteMode(true));
if (atEndOfLine())
moveLeft();
m_mode = CommandMode;
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment