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

fakevim: fewer hard-coded values for keys with control modifier



Merge-request: 131
Reviewed-by: default avatarhjk <qtc-committer@nokia.com>
parent 1d715abf
...@@ -666,10 +666,10 @@ EventResult FakeVimHandler::Private::handleEvent(QKeyEvent *ev) ...@@ -666,10 +666,10 @@ EventResult FakeVimHandler::Private::handleEvent(QKeyEvent *ev)
if ((mods & Qt::ControlModifier) != 0) { if ((mods & Qt::ControlModifier) != 0) {
if (key >= Key_A && key <= Key_Z) if (key >= Key_A && key <= Key_Z)
key += 32; // make it lower case key = shift(key); // make it lower case
key += 256; key = control(key);
} else if (key >= Key_A && key <= Key_Z && (mods & Qt::ShiftModifier) == 0) { } else if (key >= Key_A && key <= Key_Z && (mods & Qt::ShiftModifier) == 0) {
key += 32; key = shift(key);
} }
QTC_ASSERT(!(m_mode != InsertMode && m_tc.atBlockEnd() && m_tc.block().length() > 1), QTC_ASSERT(!(m_mode != InsertMode && m_tc.atBlockEnd() && m_tc.block().length() > 1),
...@@ -1956,7 +1956,7 @@ EventResult FakeVimHandler::Private::handleInsertMode(int key, int, ...@@ -1956,7 +1956,7 @@ EventResult FakeVimHandler::Private::handleInsertMode(int key, int,
const QString &text) const QString &text)
{ {
if (key == Key_Escape || key == 27 || key == control('c') || if (key == Key_Escape || key == 27 || key == control('c') ||
key == 379 /* ^[ */) { key == control(Key_BracketLeft)) {
if (isVisualBlockMode() && !m_lastInsertion.contains('\n')) { if (isVisualBlockMode() && !m_lastInsertion.contains('\n')) {
leaveVisualMode(); leaveVisualMode();
joinPreviousEditBlock(); joinPreviousEditBlock();
......
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