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