fakevim: make <Esc> leave DeleteSubMode

Task-number: QTCREATORBUG-5636
Change-Id: I875b469d937e63b3486fe64c2763cf536b89ac8f
Reviewed-on: http://codereview.qt.nokia.com/2553
Reviewed-by: hjk <qthjk@ovi.com>
This commit is contained in:
hjk
2011-08-03 11:58:59 +02:00
committed by hjk
parent 18b74f087b
commit d759a213f9

View File

@@ -1113,14 +1113,17 @@ bool FakeVimHandler::Private::wantsOverride(QKeyEvent *ev)
if (key == Key_Escape) {
if (m_subsubmode == SearchSubSubMode)
return true;
// Not sure this feels good. People often hit Esc several times
if (isNoVisualMode() && m_mode == CommandMode
&& m_opcount.isEmpty() && m_mvcount.isEmpty())
// Not sure this feels good. People often hit Esc several times.
if (isNoVisualMode()
&& m_mode == CommandMode
&& m_submode == NoSubMode
&& m_opcount.isEmpty()
&& m_mvcount.isEmpty())
return false;
return true;
}
// We are interested in overriding most Ctrl key combinations
// We are interested in overriding most Ctrl key combinations.
if (mods == RealControlModifier
&& !config(ConfigPassControlKey).toBool()
&& ((key >= Key_A && key <= Key_Z && key != Key_K)
@@ -1137,7 +1140,7 @@ bool FakeVimHandler::Private::wantsOverride(QKeyEvent *ev)
return true;
}
// Let other shortcuts trigger
// Let other shortcuts trigger.
return false;
}