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

fakevim: Escape should reset command mode no matter which state the editor was in



Merge-request: 131
Reviewed-by: default avatarhjk <qtc-committer@nokia.com>
parent 709fbf08
......@@ -1165,7 +1165,17 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
{
EventResult handled = EventHandled;
if (m_subsubmode == FtSubSubMode) {
if (key == Key_Escape || key == control(Key_BracketLeft)) {
if (isVisualMode()) {
leaveVisualMode();
} else if (m_submode != NoSubMode) {
m_submode = NoSubMode;
m_subsubmode = NoSubSubMode;
finishMovement();
} else {
resetCommandMode();
}
} else if (m_subsubmode == FtSubSubMode) {
m_semicolonType = m_subsubdata;
m_semicolonKey = key;
bool valid = handleFfTt(key);
......@@ -1963,16 +1973,6 @@ EventResult FakeVimHandler::Private::handleCommandMode(int key, int unmodified,
} else if (key == control(Key_BracketRight)) {
handleExCommand("tag");
} else if (key == Key_Escape || key == control(Key_BracketLeft)) {
if (isVisualMode()) {
leaveVisualMode();
} else if (m_submode != NoSubMode) {
m_submode = NoSubMode;
m_subsubmode = NoSubSubMode;
finishMovement();
} else {
resetCommandMode();
}
} else {
//qDebug() << "IGNORED IN COMMAND MODE: " << key << text
// << " VISUAL: " << m_visualMode;
......
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