From 7626f431d84fc3a6eb82d0d23d436e3e31e991ce Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Fri, 26 Apr 2024 16:21:56 +0200 Subject: fix(ui): update ext_ui widgets when attaching non-remote UI Problem: Updating internalized UI capabilities is postponed until a remote UI attaches. Solution: Always update active UI widgets in ui_refresh(). --- src/nvim/ui.c | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'src') diff --git a/src/nvim/ui.c b/src/nvim/ui.c index 75af543448..dd3bb53dde 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -194,15 +194,6 @@ void ui_refresh(void) abort(); } - if (!ui_active()) { - return; - } - - if (updating_screen) { - ui_schedule_refresh(); - return; - } - int width = INT_MAX; int height = INT_MAX; bool ext_widgets[kUIExtCount]; @@ -234,11 +225,19 @@ void ui_refresh(void) } ui_ext[i] = ext_widgets[i]; if (i < kUIGlobalCount) { - ui_call_option_set(cstr_as_string(ui_ext_names[i]), - BOOLEAN_OBJ(ext_widgets[i])); + ui_call_option_set(cstr_as_string(ui_ext_names[i]), BOOLEAN_OBJ(ext_widgets[i])); } } + if (!ui_active()) { + return; + } + + if (updating_screen) { + ui_schedule_refresh(); + return; + } + ui_default_colors_set(); int save_p_lz = p_lz; -- cgit From b8c1b36061f443f82f34f3d4fe7807fc33edefa6 Mon Sep 17 00:00:00 2001 From: Luuk van Baal Date: Sat, 27 Apr 2024 01:00:55 +0200 Subject: 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. --- src/nvim/ui.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/ui.c b/src/nvim/ui.c index dd3bb53dde..27458d588b 100644 --- a/src/nvim/ui.c +++ b/src/nvim/ui.c @@ -218,10 +218,13 @@ void ui_refresh(void) if (i < kUIGlobalCount) { 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]) { set_option_value(kOptCmdheight, NUMBER_OPTVAL(0), 0); command_height(); + FOR_ALL_TABS(tp) { + tp->tp_ch_used = 0; + } } ui_ext[i] = ext_widgets[i]; if (i < kUIGlobalCount) { -- cgit