diff --git a/spec/atom/vim-mode-spec.coffee b/spec/atom/vim-mode-spec.coffee index 0c63759ce..17ddc3a36 100644 --- a/spec/atom/vim-mode-spec.coffee +++ b/spec/atom/vim-mode-spec.coffee @@ -14,12 +14,18 @@ describe "VimMode", -> expect(editor).toHaveClass 'command-mode' describe "command-mode", -> - it "stops propagation on key events that don't have bindings so that they don't get inserted", -> + it "stops propagation on key events would otherwise insert a character, but allows unhandled non-insertions through", -> event = keydownEvent('\\') spyOn(event, 'stopPropagation') editor.trigger event expect(event.stopPropagation).toHaveBeenCalled() + event = keydownEvent('s', metaKey: true) + spyOn(event, 'stopPropagation') + editor.trigger event + expect(event.stopPropagation).not.toHaveBeenCalled() + + describe "the i keybinding", -> it "puts the editor into insert mode", -> expect(editor).not.toHaveClass 'insert-mode' diff --git a/src/atom/vim-mode.coffee b/src/atom/vim-mode.coffee index 11711bfc2..3e3132efe 100644 --- a/src/atom/vim-mode.coffee +++ b/src/atom/vim-mode.coffee @@ -18,9 +18,9 @@ class VimMode setupCommandMode: -> atom.bindKeys '.command-mode', (e) -> - if e.keystroke.match /\d/ + if e.keystroke.match /^\d$/ return 'command-mode:numeric-prefix' - if e.keystroke.match /./ + if e.keystroke.match /^.$/ return false @bindCommandModeKeys