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

fakevim: handle ctrl-[ and ctrl-] in the same way as letters with control modifier



Merge-request: 131
Reviewed-by: default avatarhjk <qtc-committer@nokia.com>
parent 9b6cfa47
......@@ -589,7 +589,7 @@ bool FakeVimHandler::Private::wantsOverride(QKeyEvent *ev)
const int mods = ev->modifiers();
KEY_DEBUG("SHORTCUT OVERRIDE" << key << " PASSING: " << m_passing);
if (key == Key_Escape || (mods == Qt::ControlModifier && key == Key_BracketLeft)) {
if (key == Key_Escape) {
// Not sure this feels good. People often hit Esc several times
if (isNoVisualMode() && m_mode == CommandMode)
return false;
......@@ -597,7 +597,9 @@ bool FakeVimHandler::Private::wantsOverride(QKeyEvent *ev)
}
// We are interested in overriding most Ctrl key combinations
if (mods == Qt::ControlModifier && key >= Key_A && key <= Key_Z && key != Key_K) {
if (mods == Qt::ControlModifier
&& ((key >= Key_A && key <= Key_Z && key != Key_K)
|| key == Key_BracketLeft || key == Key_BracketRight)) {
// Ctrl-K is special as it is the Core's default notion of Locator
if (m_passing) {
KEY_DEBUG(" PASSING CTRL KEY");
......
Supports Markdown
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