2024-04-09 04:26:16 -07:00
|
|
|
local t = require('test.functional.testutil')()
|
2024-04-08 02:03:20 -07:00
|
|
|
local clear = t.clear
|
|
|
|
local command = t.command
|
|
|
|
local fn = t.fn
|
|
|
|
local feed = t.feed
|
|
|
|
local expect = t.expect
|
|
|
|
local eq = t.eq
|
|
|
|
local eval = t.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)
|