mirror of
https://github.com/neovim/neovim.git
synced 2024-12-23 20:55:18 -07:00
e61228a214
Before calling "attach" a screen object is just a dummy container for (row, col) values whose purpose is to be sent as part of the "attach" function call anyway. Just create the screen in an attached state directly. Keep the complete (row, col, options) config together. It is still completely valid to later detach and re-attach as needed, including to another session.
63 lines
2.0 KiB
Lua
63 lines
2.0 KiB
Lua
-- Normal mode tests.
|
||
|
||
local t = require('test.testutil')
|
||
local n = require('test.functional.testnvim')()
|
||
local Screen = require('test.functional.ui.screen')
|
||
|
||
local clear = n.clear
|
||
local feed = n.feed
|
||
local fn = n.fn
|
||
local command = n.command
|
||
local eq = t.eq
|
||
local api = n.api
|
||
|
||
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)
|
||
fn.termopen(
|
||
{ n.nvim_prog, '--clean', '--cmd', 'startinsert' },
|
||
{ env = { VIMRUNTIME = os.getenv('VIMRUNTIME') } }
|
||
)
|
||
screen:expect({
|
||
grid = [[
|
||
^ |
|
||
~ |*13
|
||
[No Name] 0,1 All|
|
||
-- INSERT -- |
|
||
|
|
||
]],
|
||
attr_ids = {},
|
||
})
|
||
end)
|
||
|
||
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)
|
||
end)
|