Files
neovim/test/functional/ui/cmdline2_spec.lua
luukvbaal 5871d26779 fix(autocmd): 'cmdheight' OptionSet with valid window grids (#34619)
Problem:  OptionSet autocmd emitted with invalid grids after entering
          tabpage with different 'cmdheight'.
Solution: First call `tabpage_check_windows()` before changing 'cmdheight'.
          Add a test that exercises the `vim._extui` cmdline.
2025-06-24 10:25:46 +02:00

47 lines
1.6 KiB
Lua

-- Tests for (protocol-driven) ui2, intended to replace the legacy message grid UI.
local n = require('test.functional.testnvim')()
local Screen = require('test.functional.ui.screen')
local clear, exec, exec_lua, feed = n.clear, n.exec, n.exec_lua, n.feed
describe('cmdline2', function()
local screen
before_each(function()
clear()
screen = Screen.new()
screen:add_extra_attr_ids({
[100] = { foreground = Screen.colors.Magenta1, bold = true },
})
exec_lua(function()
require('vim._extui').enable({})
end)
end)
it("no crash for invalid grid after 'cmdheight' OptionSet", function()
exec('tabnew | tabprev')
feed(':set ch=0')
screen:expect([[
{5: }{100:2}{5: [No Name] }{24: [No Name] }{2: }{24:X}|
|
{1:~ }|*11
{16::}{15:set} {16:ch}{15:=}0^ |
]])
feed('<CR>')
exec('tabnext')
screen:expect([[
{24: [No Name] }{5: }{100:2}{5: [No Name] }{2: }{24:X}|
^ |
{1:~ }|*11
{16::}{15:set} {16:ch}{15:=}0 |
]])
exec('tabnext')
screen:expect([[
{5: }{100:2}{5: [No Name] }{24: [No Name] }{2: }{24:X}|
^ |
{1:~ }|*12
]])
n.assert_alive()
end)
end)