Skip to content

Commit

Permalink
Disallow Cmd+<Vim movement keys> combinations for cursor jump
Browse files Browse the repository at this point in the history
  • Loading branch information
johnnovak committed Jul 13, 2024
1 parent 53d8c0a commit 456cc43
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/main.nim
Original file line number Diff line number Diff line change
Expand Up @@ -1301,7 +1301,8 @@ proc updateWalkKeys(a) =


const
AllWasdMoveKeys = {keyQ, keyW, keyE, keyA, keyS, keyD}
VimMoveKeys = {keyH, keyJ, keyK, keyL}
AllWasdMoveKeys = {keyQ, keyW, keyE, keyA, keyS, keyD}
DiagonalMoveLetterKeys = {keyY, keyU, keyB, keyN}


Expand Down Expand Up @@ -6826,6 +6827,13 @@ proc handleGlobalKeyEvents(a) =
elif ke.key in DiagonalMoveLetterKeys:
# Disallow Ctrl+Y/U/B/N panning as it would interfere with shorcuts
return

elif a.prefs.modifierKeyMode in {mkmCommandAlt, mkmCommandShift} and
ke.key in VimMoveKeys:
# Disallow Cmd+H/J/K/L jump as Cmd+H conflicts with the macOS hide
# window shortcut
return

else:
s = CursorJump

Expand Down

0 comments on commit 456cc43

Please sign in to comment.