robin/laufey

git clone https://git.robinwobin.dev/robin/laufey

Justin M. Keyesfeat(exmode): "1q:", :exmode #41010fbcb7a056c

master
1.0 KiB42 linesraw
1local t = require('test.testutil')
2local n = require('test.functional.testnvim')()
3
4local describe, it, before_each = t.describe, t.it, t.before_each
5local clear = n.clear
6local command = n.command
7local fn = n.fn
8local feed = n.feed
9local expect = n.expect
10local eq = t.eq
11local eval = n.eval
12
13before_each(clear)
14
15describe(':normal!', function()
16  it('can get out of Insert mode if called from Ex mode #17924', function()
17    feed('1q:normal! Ifoo<CR>')
18    feed('visual<CR>')
19    expect('foo')
20  end)
21
22  it('does not execute command in Ex mode when running out of characters', function()
23    command('let g:var = 0')
24    command('normal! 1q:let g:var = 1')
25    eq(0, eval('g:var'))
26  end)
27
28  it('"1q:insert" does not hang #17980', function()
29    command('normal! 1q:insert')
30    expect('')
31  end)
32
33  it('can stop Visual mode without closing cmdwin vim-patch:9.0.0234', function()
34    feed('q:')
35    feed('v')
36    eq('v', fn.mode(1))
37    eq(':', fn.getcmdwintype())
38    command('normal! \027')
39    eq('n', fn.mode(1))
40    eq(':', fn.getcmdwintype())
41  end)
42end)