From 68dd95591d5351f4be245468726f6bbb330da3b9 Mon Sep 17 00:00:00 2001 From: Le Tan Date: Fri, 31 Aug 2018 20:22:42 +0800 Subject: [PATCH] vim: add x for exemption key --- src/resources/vnote.ini | 3 ++- src/utils/vvim.cpp | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/resources/vnote.ini b/src/resources/vnote.ini index f18f05e2..61a161bf 100644 --- a/src/resources/vnote.ini +++ b/src/resources/vnote.ini @@ -187,7 +187,8 @@ enable_backup_file=true ; Skipped keys in Vim mode ; c: Ctrl+C ; v: Ctrl+V -vim_exemption_keys=cv +; x: Ctrl+X +vim_exemption_keys=cvx ; Path of the flash page, related to the configuration folder ; Could be absolute path diff --git a/src/utils/vvim.cpp b/src/utils/vvim.cpp index 0551791f..2ce6ac74 100644 --- a/src/utils/vvim.cpp +++ b/src/utils/vvim.cpp @@ -1628,6 +1628,12 @@ bool VVim::handleKeyPressEvent(int key, int modifiers, int *p_autoIndentPos) processCommand(m_tokens); setMode(VimMode::Normal); break; + } else if (VUtils::isControlModifierForVim(modifiers)) { + if (g_config->getVimExemptionKeys().contains('x')) { + // Let it be handled outside. + resetState(); + goto exit; + } } break;