mirror of
https://github.com/neovim/neovim.git
synced 2024-12-31 17:13:26 -07:00
fix(ui): set 'cmdheight' to zero for all open tabpages
Problem: Enabling ext_messages claims to set 'cmdheight' to zero, but only does so for the current tabpage. Solution: Set stored 'cmdheight' value to zero for all tabpages.
This commit is contained in:
parent
7626f431d8
commit
b8c1b36061
@ -218,10 +218,13 @@ void ui_refresh(void)
|
|||||||
if (i < kUIGlobalCount) {
|
if (i < kUIGlobalCount) {
|
||||||
ext_widgets[i] |= ui_cb_ext[i];
|
ext_widgets[i] |= ui_cb_ext[i];
|
||||||
}
|
}
|
||||||
// Set 'cmdheight' to zero when ext_messages becomes active.
|
// Set 'cmdheight' to zero when ext_messages becomes active for all tabpages.
|
||||||
if (i == kUIMessages && !ui_ext[i] && ext_widgets[i]) {
|
if (i == kUIMessages && !ui_ext[i] && ext_widgets[i]) {
|
||||||
set_option_value(kOptCmdheight, NUMBER_OPTVAL(0), 0);
|
set_option_value(kOptCmdheight, NUMBER_OPTVAL(0), 0);
|
||||||
command_height();
|
command_height();
|
||||||
|
FOR_ALL_TABS(tp) {
|
||||||
|
tp->tp_ch_used = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ui_ext[i] = ext_widgets[i];
|
ui_ext[i] = ext_widgets[i];
|
||||||
if (i < kUIGlobalCount) {
|
if (i < kUIGlobalCount) {
|
||||||
|
@ -163,6 +163,13 @@ describe('vim.ui_attach', function()
|
|||||||
screen:attach()
|
screen:attach()
|
||||||
eq(1, n.api.nvim_get_option_value('cmdheight', {}))
|
eq(1, n.api.nvim_get_option_value('cmdheight', {}))
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
it("ui_refresh() sets 'cmdheight' for all open tabpages with ext_messages", function()
|
||||||
|
exec_lua('vim.cmd.tabnew()')
|
||||||
|
exec_lua('vim.ui_attach(ns, { ext_messages = true }, on_event)')
|
||||||
|
exec_lua('vim.cmd.tabnext()')
|
||||||
|
eq(0, n.api.nvim_get_option_value('cmdheight', {}))
|
||||||
|
end)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
describe('vim.ui_attach', function()
|
describe('vim.ui_attach', function()
|
||||||
|
Loading…
Reference in New Issue
Block a user