diff --git a/spec/keymap-spec.coffee b/spec/keymap-spec.coffee index a14d03d8c..015a822d5 100644 --- a/spec/keymap-spec.coffee +++ b/spec/keymap-spec.coffee @@ -203,6 +203,7 @@ describe "Keymap", -> describe "when a second keystroke added to the first to match a multi-stroke binding completely", -> it "triggers the event associated with the matched multi-stroke binding", -> expect(keymap.handleKeyEvent(keydownEvent('x', target: fragment[0], ctrlKey: true))).toBeFalsy() + expect(keymap.handleKeyEvent(keydownEvent('ctrl', target: fragment[0]))).toBeFalsy() # This simulates actual key event behavior expect(keymap.handleKeyEvent(keydownEvent('c', target: fragment[0], ctrlKey: true))).toBeFalsy() expect(quitHandler).toHaveBeenCalled() diff --git a/src/keymap.coffee b/src/keymap.coffee index 89aa9f473..ad7c92ce7 100644 --- a/src/keymap.coffee +++ b/src/keymap.coffee @@ -177,7 +177,10 @@ class Keymap multiKeystrokeStringForEvent: (event) -> currentKeystroke = @keystrokeStringForEvent(event) if @queuedKeystrokes - @queuedKeystrokes + ' ' + currentKeystroke + if currentKeystroke in Modifiers + @queuedKeystrokes + else + @queuedKeystrokes + ' ' + currentKeystroke else currentKeystroke