2022-04-02 17:58:49 -07:00
|
|
|
local helpers = require('test.functional.helpers')(after_each)
|
|
|
|
local clear = helpers.clear
|
2022-04-03 07:54:07 -07:00
|
|
|
local command = helpers.command
|
2024-01-12 10:59:57 -07:00
|
|
|
local fn = helpers.fn
|
2022-04-02 17:58:49 -07:00
|
|
|
local feed = helpers.feed
|
|
|
|
local expect = helpers.expect
|
2022-04-03 07:54:07 -07:00
|
|
|
local eq = helpers.eq
|
|
|
|
local eval = helpers.eval
|
2022-04-02 17:58:49 -07:00
|
|
|
|
|
|
|
before_each(clear)
|
|
|
|
|
2022-08-22 20:39:25 -07:00
|
|
|
describe(':normal!', function()
|
2022-04-02 17:58:49 -07:00
|
|
|
it('can get out of Insert mode if called from Ex mode #17924', function()
|
|
|
|
feed('gQnormal! Ifoo<CR>')
|
|
|
|
expect('foo')
|
|
|
|
end)
|
2022-04-03 07:54:07 -07:00
|
|
|
|
2022-08-22 20:39:25 -07:00
|
|
|
it('does not execute command in Ex mode when running out of characters', function()
|
2022-04-03 07:54:07 -07:00
|
|
|
command('let g:var = 0')
|
|
|
|
command('normal! gQlet g:var = 1')
|
|
|
|
eq(0, eval('g:var'))
|
|
|
|
end)
|
|
|
|
|
2022-08-22 20:39:25 -07:00
|
|
|
it('gQinsert does not hang #17980', function()
|
2022-04-03 07:54:07 -07:00
|
|
|
command('normal! gQinsert')
|
|
|
|
expect('')
|
|
|
|
end)
|
2022-08-22 20:39:25 -07:00
|
|
|
|
|
|
|
it('can stop Visual mode without closing cmdwin vim-patch:9.0.0234', function()
|
|
|
|
feed('q:')
|
|
|
|
feed('v')
|
2024-01-12 10:59:57 -07:00
|
|
|
eq('v', fn.mode(1))
|
|
|
|
eq(':', fn.getcmdwintype())
|
2022-08-22 20:39:25 -07:00
|
|
|
command('normal! \027')
|
2024-01-12 10:59:57 -07:00
|
|
|
eq('n', fn.mode(1))
|
|
|
|
eq(':', fn.getcmdwintype())
|
2022-08-22 20:39:25 -07:00
|
|
|
end)
|
2022-04-02 17:58:49 -07:00
|
|
|
end)
|