From 3c7c824bdc08052239285b0028885fb610d36d41 Mon Sep 17 00:00:00 2001 From: luukvbaal Date: Fri, 2 May 2025 13:13:12 +0200 Subject: fix(extui): check option values after VimEnter (#33768) Problem: Not picking up configured option values when enabling _extui after startup. Solution: Check option values when enabing _extui. Fix https://github.com/neovim/neovim/issues/33767 --- runtime/lua/vim/_extui.lua | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'runtime/lua/vim/_extui.lua') diff --git a/runtime/lua/vim/_extui.lua b/runtime/lua/vim/_extui.lua index 8f8ebfcd2b..d6d56de186 100644 --- a/runtime/lua/vim/_extui.lua +++ b/runtime/lua/vim/_extui.lua @@ -75,6 +75,7 @@ function M.enable(opts) -- The visibility and appearance of the cmdline and message box window is -- dependent on some option values. Reconfigure windows when option value -- has changed and after VimEnter when the user configured value is known. + -- TODO: Reconsider what is needed when this module is enabled by default early in startup. local function check_opt(name, value) if name == 'cmdheight' then -- 'cmdheight' set; (un)hide cmdline window and set its height. @@ -91,6 +92,11 @@ function M.enable(opts) end end + if vim.v.vim_did_enter == 1 then + check_opt('cmdheight', vim.o.cmdheight) + check_opt('termguicolors', vim.o.termguicolors) + end + api.nvim_create_autocmd('OptionSet', { group = ext.augroup, pattern = { 'cmdheight', 'termguicolors' }, -- cgit