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

fakevim: only overwrite m_tc with EDITOR's cursor if necessary



only ex commands that are handled externally might modify the cursor position w/o updating m_tc

Merge-request: 113
Reviewed-by: default avatarhjk <qtc-committer@nokia.com>
parent 7a71ee11
......@@ -2132,15 +2132,10 @@ EventResult FakeVimHandler::Private::handleMiniBufferModes(int key, int unmodifi
if (!m_commandBuffer.isEmpty()) {
m_commandHistory.takeLast();
m_commandHistory.append(m_commandBuffer);
// FIXME: This was inserted to prevent crashes when the
// editor 'vanishes' but broke things like :<line>.
// How can the crash be reproduced?
// when EDITOR(setTextCursor(m_tc));
handleExCommand(m_commandBuffer);
//if (m_textedit || m_plaintextedit) {
// m_tc = EDITOR(textCursor());
leaveVisualMode();
//}
if (m_textedit || m_plaintextedit) {
leaveVisualMode();
}
}
} else if (unmodified == Key_Return && isSearchMode()) {
if (!m_commandBuffer.isEmpty()) {
......@@ -2559,7 +2554,10 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0)
void FakeVimHandler::Private::passUnknownExCommand(const QString &cmd)
{
EDITOR(setTextCursor(m_tc));
emit q->handleExCommandRequested(cmd);
if (m_plaintextedit || m_textedit)
m_tc = EDITOR(textCursor());
}
void FakeVimHandler::Private::passUnknownSetCommand(const QString &arg)
......
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