forked from qt-creator/qt-creator
fakevim: improve logic for setting the '<' mark
This commit is contained in:
@@ -384,6 +384,9 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_visualMode != NoVisualMode)
|
||||||
|
m_marks['>'] = m_tc.position();
|
||||||
|
|
||||||
if (m_submode == ChangeSubMode) {
|
if (m_submode == ChangeSubMode) {
|
||||||
if (!dotCommand.isEmpty())
|
if (!dotCommand.isEmpty())
|
||||||
m_dotCommand = "c" + dotCommand;
|
m_dotCommand = "c" + dotCommand;
|
||||||
@@ -615,10 +618,8 @@ bool FakeVimHandler::Private::handleCommandMode(int key, const QString &text)
|
|||||||
} else if (key == ':') {
|
} else if (key == ':') {
|
||||||
m_mode = ExMode;
|
m_mode = ExMode;
|
||||||
m_commandBuffer.clear();
|
m_commandBuffer.clear();
|
||||||
if (m_visualMode != NoVisualMode) {
|
if (m_visualMode != NoVisualMode)
|
||||||
m_commandBuffer = "'<,'>";
|
m_commandBuffer = "'<,'>";
|
||||||
leaveVisualMode();
|
|
||||||
}
|
|
||||||
m_commandHistory.append(QString());
|
m_commandHistory.append(QString());
|
||||||
m_commandHistoryIndex = m_commandHistory.size() - 1;
|
m_commandHistoryIndex = m_commandHistory.size() - 1;
|
||||||
updateMiniBuffer();
|
updateMiniBuffer();
|
||||||
@@ -640,7 +641,6 @@ bool FakeVimHandler::Private::handleCommandMode(int key, const QString &text)
|
|||||||
m_submode = FilterSubMode;
|
m_submode = FilterSubMode;
|
||||||
} else if (key == '!' && m_visualMode == VisualLineMode) {
|
} else if (key == '!' && m_visualMode == VisualLineMode) {
|
||||||
m_mode = ExMode;
|
m_mode = ExMode;
|
||||||
m_marks['>'] = m_tc.position();
|
|
||||||
m_commandBuffer = "'<,'>!";
|
m_commandBuffer = "'<,'>!";
|
||||||
m_commandHistory.append(QString());
|
m_commandHistory.append(QString());
|
||||||
m_commandHistoryIndex = m_commandHistory.size() - 1;
|
m_commandHistoryIndex = m_commandHistory.size() - 1;
|
||||||
@@ -1021,6 +1021,7 @@ bool FakeVimHandler::Private::handleMiniBufferModes(int key, const QString &text
|
|||||||
m_commandHistory.takeLast();
|
m_commandHistory.takeLast();
|
||||||
m_commandHistory.append(m_commandBuffer);
|
m_commandHistory.append(m_commandBuffer);
|
||||||
handleExCommand(m_commandBuffer);
|
handleExCommand(m_commandBuffer);
|
||||||
|
leaveVisualMode();
|
||||||
}
|
}
|
||||||
} else if (key == Key_Return && isSearchMode()) {
|
} else if (key == Key_Return && isSearchMode()) {
|
||||||
if (!m_commandBuffer.isEmpty()) {
|
if (!m_commandBuffer.isEmpty()) {
|
||||||
@@ -1140,7 +1141,6 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0)
|
|||||||
if (cmd.startsWith("%"))
|
if (cmd.startsWith("%"))
|
||||||
cmd = "1,$" + cmd.mid(1);
|
cmd = "1,$" + cmd.mid(1);
|
||||||
|
|
||||||
m_marks['>'] = m_tc.position();
|
|
||||||
int beginLine = -1;
|
int beginLine = -1;
|
||||||
int endLine = -1;
|
int endLine = -1;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user