robin/laufey

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

Justin M. KeyesMerge #40865 from justinmk/fixcif907614088

master
2.2 KiB70 linesraw
1-- Normal mode tests.
2
3local t = require('test.testutil')
4local n = require('test.functional.testnvim')()
5local Screen = require('test.functional.ui.screen')
6
7local describe, it, before_each = t.describe, t.it, t.before_each
8local clear = n.clear
9local feed = n.feed
10local fn = n.fn
11local command = n.command
12local eq = t.eq
13local api = n.api
14
15describe('Normal mode', function()
16  before_each(clear)
17
18  it('setting &winhighlight or &winblend does not change curswant #27470', function()
19    fn.setline(1, { 'long long lone line', 'short line' })
20    feed('ggfi')
21    local pos = fn.getcurpos()
22    feed('j')
23    command('setlocal winblend=10 winhighlight=Visual:Search')
24    feed('k')
25    eq(pos, fn.getcurpos())
26  end)
27
28  it('&showcmd does not crash with :startinsert #28419', function()
29    local screen = Screen.new(60, 17)
30    fn.jobstart({ n.nvim_prog, '--clean', '--cmd', 'startinsert' }, {
31      term = true,
32      env = { VIMRUNTIME = os.getenv('VIMRUNTIME') },
33    })
34    screen:expect({
35      grid = [[
36        ^                                                            |
37        ~                                                           |*13
38        [No Name]                                 0,1            All|
39        -- INSERT --                                                |
40                                                                    |
41      ]],
42      attr_ids = {},
43    })
44  end)
45
46  it('replacing with ZWJ emoji sequences', function()
47    local screen = Screen.new(30, 8)
48    api.nvim_buf_set_lines(0, 0, -1, true, { 'abcdefg' })
49    feed('05rπŸ§‘β€πŸŒΎ') -- ZWJ
50    screen:expect([[
51      πŸ§‘β€πŸŒΎπŸ§‘β€πŸŒΎπŸ§‘β€πŸŒΎπŸ§‘β€πŸŒΎ^πŸ§‘β€πŸŒΎfg                  |
52      {1:~                             }|*6
53                                    |
54    ]])
55
56    feed('2rπŸ³οΈβ€βš§οΈ') -- ZWJ and variant selectors
57    screen:expect([[
58      πŸ§‘β€πŸŒΎπŸ§‘β€πŸŒΎπŸ§‘β€πŸŒΎπŸ§‘β€πŸŒΎπŸ³οΈβ€βš§οΈ^πŸ³οΈβ€βš§οΈg                 |
59      {1:~                             }|*6
60                                    |
61    ]])
62  end)
63
64  it('"gk" does not crash with signcolumn=yes in narrow window #31274', function()
65    feed('o<Esc>')
66    command('1vsplit | setlocal signcolumn=yes')
67    feed('gk')
68    n.assert_alive()
69  end)
70end)