neovim/test/functional/editor/mode_visual_spec.lua
Thomas Vigouroux 7cb34a341d
test(normal): CA_COMMAND_BUSY in visual select mode #15292
Fix was already applied in 5f144efefa #15688,
but this commit adds another dimension to the test.

Test correctly fails after reverting 5f144efefa.

ref #15288
2021-09-24 09:59:36 -07:00

28 lines
950 B
Lua

-- Visual-mode tests.
local helpers = require('test.functional.helpers')(after_each)
local clear = helpers.clear
local eq = helpers.eq
local eval = helpers.eval
local expect = helpers.expect
local feed = helpers.feed
local meths = helpers.meths
describe('visual-mode', function()
before_each(clear)
it("select-mode Ctrl-O doesn't cancel Ctrl-O mode when processing event #15688", function()
feed('iHello World<esc>gh<c-o>')
eq({mode='vs', blocking=false}, meths.get_mode()) -- fast event
eq({mode='vs', blocking=false}, meths.get_mode()) -- again #15288
eq(2, eval('1+1')) -- causes K_EVENT key
eq({mode='vs', blocking=false}, meths.get_mode()) -- still in ctrl-o mode
feed('^')
eq({mode='s', blocking=false}, meths.get_mode()) -- left ctrl-o mode
feed('h')
eq({mode='i', blocking=false}, meths.get_mode()) -- entered insert mode
expect('h') -- selection is the whole line and is replaced
end)
end)