1
0
mirror of https://github.com/chylex/IntelliJ-IdeaVim.git synced 2025-03-06 18:32:51 +01:00

All keys are allowed during the lookup except TAB

This commit is contained in:
Alex Plate 2019-11-28 19:38:46 +03:00
parent 59f4dc8c78
commit 17a87f80e3
No known key found for this signature in database
GPG Key ID: 0B97153C8FFEC09F

View File

@ -136,16 +136,12 @@ class VimShortcutKeyAction : AnAction(), DumbAware {
}
private fun isEnabledForLookup(keyStroke: KeyStroke): Boolean {
val allowedKeys = parseKeysSet(
"<C-[>", "<C-C>", "<Esc>", // Escape
"<BS>", // Backspace
"<C-O>", // One command
"<C-P>", // Lookup up
"<C-N>" // Lookup down
val notAllowedKeys = parseKeysSet(
"<TAB>"
)
for (keys in allowedKeys) { // XXX: Currently we cannot handle <C-\><C-N> because of the importance of <C-N> for the IDE on Linux
for (keys in notAllowedKeys) {
if (keyStroke == keys[0]) {
return true
return false
}
}
// We allow users to set custom keys that will work with lookup in case devs forgot something
@ -154,10 +150,10 @@ class VimShortcutKeyAction : AnAction(), DumbAware {
for (value in values) {
val keys = StringHelper.parseKeys(value)
if (keys.size >= 1 && keyStroke == keys[0]) {
return true
return false
}
}
return false
return true
}
private fun isShortcutConflict(keyStroke: KeyStroke): Boolean {