Commit 3ce094e4 authored by hjk's avatar hjk
Browse files

fakevim: improve logic for setting the '<' mark

parent 59b41ee2
......@@ -384,6 +384,9 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand)
return;
}
if (m_visualMode != NoVisualMode)
m_marks['>'] = m_tc.position();
if (m_submode == ChangeSubMode) {
if (!dotCommand.isEmpty())
m_dotCommand = "c" + dotCommand;
......@@ -615,10 +618,8 @@ bool FakeVimHandler::Private::handleCommandMode(int key, const QString &text)
} else if (key == ':') {
m_mode = ExMode;
m_commandBuffer.clear();
if (m_visualMode != NoVisualMode) {
if (m_visualMode != NoVisualMode)
m_commandBuffer = "'<,'>";
leaveVisualMode();
}
m_commandHistory.append(QString());
m_commandHistoryIndex = m_commandHistory.size() - 1;
updateMiniBuffer();
......@@ -640,7 +641,6 @@ bool FakeVimHandler::Private::handleCommandMode(int key, const QString &text)
m_submode = FilterSubMode;
} else if (key == '!' && m_visualMode == VisualLineMode) {
m_mode = ExMode;
m_marks['>'] = m_tc.position();
m_commandBuffer = "'<,'>!";
m_commandHistory.append(QString());
m_commandHistoryIndex = m_commandHistory.size() - 1;
......@@ -1021,6 +1021,7 @@ bool FakeVimHandler::Private::handleMiniBufferModes(int key, const QString &text
m_commandHistory.takeLast();
m_commandHistory.append(m_commandBuffer);
handleExCommand(m_commandBuffer);
leaveVisualMode();
}
} else if (key == Key_Return && isSearchMode()) {
if (!m_commandBuffer.isEmpty()) {
......@@ -1140,7 +1141,6 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0)
if (cmd.startsWith("%"))
cmd = "1,$" + cmd.mid(1);
m_marks['>'] = m_tc.position();
int beginLine = -1;
int endLine = -1;
......
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