2024-02-18 03:11:20 -07:00
|
|
|
|
-- Normal mode tests.
|
|
|
|
|
|
2024-04-20 08:44:13 -07:00
|
|
|
|
local t = require('test.testutil')
|
|
|
|
|
local n = require('test.functional.testnvim')()
|
2024-04-19 17:12:45 -07:00
|
|
|
|
local Screen = require('test.functional.ui.screen')
|
2024-04-20 08:44:13 -07:00
|
|
|
|
|
|
|
|
|
local clear = n.clear
|
|
|
|
|
local feed = n.feed
|
|
|
|
|
local fn = n.fn
|
|
|
|
|
local command = n.command
|
2024-04-08 02:03:20 -07:00
|
|
|
|
local eq = t.eq
|
2024-09-29 01:05:27 -07:00
|
|
|
|
local api = n.api
|
2024-02-18 03:11:20 -07:00
|
|
|
|
|
|
|
|
|
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)
|
2024-04-19 17:12:45 -07:00
|
|
|
|
|
|
|
|
|
it('&showcmd does not crash with :startinsert #28419', function()
|
|
|
|
|
local screen = Screen.new(60, 17)
|
|
|
|
|
fn.termopen(
|
2024-04-20 08:44:13 -07:00
|
|
|
|
{ n.nvim_prog, '--clean', '--cmd', 'startinsert' },
|
2024-04-19 17:12:45 -07:00
|
|
|
|
{ env = { VIMRUNTIME = os.getenv('VIMRUNTIME') } }
|
|
|
|
|
)
|
|
|
|
|
screen:expect({
|
|
|
|
|
grid = [[
|
|
|
|
|
^ |
|
|
|
|
|
~ |*13
|
|
|
|
|
[No Name] 0,1 All|
|
|
|
|
|
-- INSERT -- |
|
|
|
|
|
|
|
|
|
|
|
]],
|
|
|
|
|
attr_ids = {},
|
|
|
|
|
})
|
|
|
|
|
end)
|
2024-09-29 01:05:27 -07:00
|
|
|
|
|
|
|
|
|
it('replacing with ZWJ emoji sequences', function()
|
|
|
|
|
local screen = Screen.new(30, 8)
|
|
|
|
|
api.nvim_buf_set_lines(0, 0, -1, true, { 'abcdefg' })
|
|
|
|
|
feed('05r🧑🌾') -- ZWJ
|
|
|
|
|
screen:expect([[
|
|
|
|
|
🧑🌾🧑🌾🧑🌾🧑🌾^🧑🌾fg |
|
|
|
|
|
{1:~ }|*6
|
|
|
|
|
|
|
|
|
|
|
]])
|
|
|
|
|
|
|
|
|
|
feed('2r🏳️⚧️') -- ZWJ and variant selectors
|
|
|
|
|
screen:expect([[
|
|
|
|
|
🧑🌾🧑🌾🧑🌾🧑🌾🏳️⚧️^🏳️⚧️g |
|
|
|
|
|
{1:~ }|*6
|
|
|
|
|
|
|
|
|
|
|
]])
|
|
|
|
|
end)
|
2024-02-18 03:11:20 -07:00
|
|
|
|
end)
|