mirror of
https://github.com/neovim/neovim.git
synced 2025-10-26 12:27:24 +00:00
feat(ui): avoid setting 'cmdheight' with vim.ui_attach()
Problem: We allow setting 'cmdheight' to 0 with ext_messages enabled
since b72931e7. Enabling ext_messages with vim.ui_attach()
implicitly sets 'cmdheight' to 0 for BWC. When non-zero
'cmdheight' is wanted, this behavior make it unnecessarily
hard to keep track of the user configured value.
Solution: Add set_cmdheight to vim.ui_attach() opts table that can be
set to false to avoid setting 'cmdheight' to 0.
This commit is contained in:
@@ -162,6 +162,11 @@ describe('vim.ui_attach', function()
|
||||
eq(0, n.api.nvim_get_option_value('cmdheight', {}))
|
||||
end)
|
||||
|
||||
it("can attach ext_messages without changing 'cmdheight'", function()
|
||||
exec_lua('vim.ui_attach(ns, { ext_messages = true, set_cmdheight = false }, on_event)')
|
||||
eq(1, n.api.nvim_get_option_value('cmdheight', {}))
|
||||
end)
|
||||
|
||||
it('avoids recursive flushing and invalid memory access with :redraw', function()
|
||||
exec_lua([[
|
||||
_G.cmdline = 0
|
||||
|
||||
Reference in New Issue
Block a user