aboutsummaryrefslogtreecommitdiff
path: root/test/functional/editor/mode_normal_spec.lua
blob: b80723a5b9b0a97bbb7fb83b139c5e00c3d4e455 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
-- Normal mode tests.

local t = require('test.functional.testutil')()
local Screen = require('test.functional.ui.screen')
local clear = t.clear
local feed = t.feed
local fn = t.fn
local command = t.command
local eq = t.eq

describe('Normal mode', function()
  before_each(clear)

  it('setting &winhighlight or &winblend does not change curswant #27470', function()
    fn.setline(1, { 'long long lone line', 'short line' })
    feed('ggfi')
    local pos = fn.getcurpos()
    feed('j')
    command('setlocal winblend=10 winhighlight=Visual:Search')
    feed('k')
    eq(pos, fn.getcurpos())
  end)

  it('&showcmd does not crash with :startinsert #28419', function()
    local screen = Screen.new(60, 17)
    screen:attach()
    fn.termopen(
      { t.nvim_prog, '--clean', '--cmd', 'startinsert' },
      { env = { VIMRUNTIME = os.getenv('VIMRUNTIME') } }
    )
    screen:expect({
      grid = [[
        ^                                                            |
        ~                                                           |*13
        [No Name]                                 0,1            All|
        -- INSERT --                                                |
                                                                    |
      ]],
      attr_ids = {},
    })
  end)
end)