Skip to content
This repository was archived by the owner on Apr 6, 2018. It is now read-only.

Commit 30c749b

Browse files
committed
fix interaction with modifiers
1 parent 798b8e1 commit 30c749b

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

lib/utils.coffee

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
# copied from atom/atom-keymap src/helpers.coffee
2+
AtomModifierRegex = /(ctrl|alt|shift|cmd)$/
3+
14
module.exports =
25
# Public: Determines if a string should be considered linewise or character
36
#
@@ -12,3 +15,7 @@ module.exports =
1215
'linewise'
1316
else
1417
'character'
18+
19+
# copied and simplified from atom/atom-keymap src/helpers.coffee
20+
isAtomModifier: (keystroke) ->
21+
AtomModifierRegex.test(keystroke)

lib/vim-state.coffee

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ class VimState
3838

3939
@subscriptions.add atom.keymaps.onDidFailToMatchBinding (e) =>
4040
return unless e.keyboardEventTarget is @editorElement
41+
return if Utils.isAtomModifier(e.keystrokes)
42+
4143
atom.keymaps.cancelPendingState()
4244
if @mode is 'operator-pending'
4345
@resetCommandMode()

0 commit comments

Comments
 (0)