@@ -424,19 +424,33 @@ describe "VimState", ->
424424 editor .setText " line one\n line two\n "
425425 editor .setCursorBufferPosition [0 , 0 ]
426426
427- it " cancels short pending operations on unrecognized keybinding" , ->
428- keydown ' c'
429- keydown ' q' # cq doesn't work, should cancel
430- keydown ' w'
431- expect (editor .getCursorBufferPosition ()).toEqual [0 , 5 ]
432- expect (editor .getText ()).toBe " line one\n line two\n "
433- expect (vimState .mode ).toEqual ' command'
434-
435- it " cancels long pending operations on unrecognized keybinding" , ->
436- keydown ' c'
437- keydown ' i'
438- keydown ' 3' # i3 is unrecognized, should cancel the whole `ci3` sequence
439- keydown ' w'
440- expect (editor .getCursorBufferPosition ()).toEqual [0 , 5 ]
441- expect (editor .getText ()).toBe " line one\n line two\n "
442- expect (vimState .mode ).toEqual ' command'
427+ describe " in operator-pending mode" , ->
428+ beforeEach ->
429+ keydown ' c'
430+
431+ it " cancels short pending operations on unrecognized keybinding" , ->
432+ keydown ' q' # cq doesn't work, should cancel
433+ keydown ' w'
434+ expect (editor .getCursorBufferPosition ()).toEqual [0 , 5 ]
435+ expect (editor .getText ()).toBe " line one\n line two\n "
436+ expect (vimState .mode ).toEqual ' command'
437+
438+ it " cancels long pending operations on unrecognized keybinding" , ->
439+ keydown ' i'
440+ keydown ' 3' # i3 is unrecognized, should cancel the whole `ci3` sequence
441+ keydown ' w'
442+ expect (editor .getCursorBufferPosition ()).toEqual [0 , 5 ]
443+ expect (editor .getText ()).toBe " line one\n line two\n "
444+ expect (vimState .mode ).toEqual ' command'
445+
446+ describe " in visual mode" , ->
447+ beforeEach ->
448+ keydown ' v'
449+
450+ it " cancels whole unrecognized keybinding" , ->
451+ keydown ' i'
452+ keydown ' 3' # i3 is unrecognized, should cancel the whole `i3` sequence
453+ keydown ' w'
454+ expect (editor .getCursorBufferPosition ()).toEqual [0 , 6 ]
455+ expect (editor .getSelectedText ()).toBe " line o"
456+ expect (vimState .mode ).toEqual ' visual'
0 commit comments