Commit 4deff6fc authored by hjk's avatar hjk
Browse files

fakevim: fix display of error messages.

They have been overwritten by empty strings previously too quickly.
parent 12431915
...@@ -638,6 +638,7 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand) ...@@ -638,6 +638,7 @@ void FakeVimHandler::Private::finishMovement(const QString &dotCommand)
int endLine = lineForPosition(position()); int endLine = lineForPosition(position());
setPosition(qMin(anchor(), position())); setPosition(qMin(anchor(), position()));
enterExMode(); enterExMode();
m_currentMessage.clear();
m_commandBuffer = QString(".,+%1!").arg(qAbs(endLine - beginLine)); m_commandBuffer = QString(".,+%1!").arg(qAbs(endLine - beginLine));
m_commandHistory.append(QString()); m_commandHistory.append(QString());
m_commandHistoryIndex = m_commandHistory.size() - 1; m_commandHistoryIndex = m_commandHistory.size() - 1;
...@@ -766,7 +767,6 @@ void FakeVimHandler::Private::updateMiniBuffer() ...@@ -766,7 +767,6 @@ void FakeVimHandler::Private::updateMiniBuffer()
msg = "-- PASSING -- "; msg = "-- PASSING -- ";
} else if (!m_currentMessage.isEmpty()) { } else if (!m_currentMessage.isEmpty()) {
msg = m_currentMessage; msg = m_currentMessage;
m_currentMessage.clear();
} else if (m_mode == CommandMode && m_visualMode != NoVisualMode) { } else if (m_mode == CommandMode && m_visualMode != NoVisualMode) {
if (m_visualMode == VisualCharMode) { if (m_visualMode == VisualCharMode) {
msg = "-- VISUAL --"; msg = "-- VISUAL --";
...@@ -991,6 +991,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified, ...@@ -991,6 +991,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
finishMovement(); finishMovement();
} else if (key == ':') { } else if (key == ':') {
enterExMode(); enterExMode();
m_currentMessage.clear();
m_commandBuffer.clear(); m_commandBuffer.clear();
if (m_visualMode != NoVisualMode) if (m_visualMode != NoVisualMode)
m_commandBuffer = "'<,'>"; m_commandBuffer = "'<,'>";
...@@ -1005,6 +1006,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified, ...@@ -1005,6 +1006,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
// FIXME: make core find dialog sufficiently flexible to // FIXME: make core find dialog sufficiently flexible to
// produce the "default vi" behaviour too. For now, roll our own. // produce the "default vi" behaviour too. For now, roll our own.
enterExMode(); // to get the cursor disabled enterExMode(); // to get the cursor disabled
m_currentMessage.clear();
m_mode = (key == '/') ? SearchForwardMode : SearchBackwardMode; m_mode = (key == '/') ? SearchForwardMode : SearchBackwardMode;
m_commandBuffer.clear(); m_commandBuffer.clear();
m_searchHistory.append(QString()); m_searchHistory.append(QString());
...@@ -1033,6 +1035,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified, ...@@ -1033,6 +1035,7 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
m_submode = FilterSubMode; m_submode = FilterSubMode;
} else if (key == '!' && m_visualMode != NoVisualMode) { } else if (key == '!' && m_visualMode != NoVisualMode) {
enterExMode(); enterExMode();
m_currentMessage.clear();
m_commandBuffer = "'<,'>!"; m_commandBuffer = "'<,'>!";
m_commandHistory.append(QString()); m_commandHistory.append(QString());
m_commandHistoryIndex = m_commandHistory.size() - 1; m_commandHistoryIndex = m_commandHistory.size() - 1;
...@@ -1971,6 +1974,7 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0) ...@@ -1971,6 +1974,7 @@ void FakeVimHandler::Private::handleExCommand(const QString &cmd0)
enterCommandMode(); enterCommandMode();
updateMiniBuffer(); updateMiniBuffer();
} else { } else {
enterCommandMode();
showRedMessage(tr("E492: Not an editor command: ") + cmd0); showRedMessage(tr("E492: Not an editor command: ") + cmd0);
} }
} }
......
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