From f40db9a2240d24f7e042bfcb5b7f41a1abded973 Mon Sep 17 00:00:00 2001 From: shadmansaleh <13149513+shadmansaleh@users.noreply.github.com> Date: Fri, 5 Aug 2022 08:37:28 +0600 Subject: [PATCH] fixup: prevent wildmode=list from disapearing don't call redrawstatus on command mode if wildmode is set to list fixes #781 --- lua/lualine.lua | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/lua/lualine.lua b/lua/lualine.lua index fcbbc5e..cd0da03 100644 --- a/lua/lualine.lua +++ b/lua/lualine.lua @@ -438,11 +438,17 @@ local function refresh(opts) end end - -- call redraw - if vim.tbl_contains(opts.place, 'statusline') or vim.tbl_contains(opts.place, 'winbar') then - vim.cmd('redrawstatus') - elseif vim.tbl_contains(opts.place, 'tabline') then - vim.cmd('redrawtabline') + -- call redraw on command mode unless &wildmode=list + -- workaround for + -- https://github.com/neovim/neovim/issues/19472 + -- https://github.com/nvim-lualine/lualine.nvim/issues/781 + -- Note when wildmode is set to list https://github.com/neovim/neovim/issues/19472 issue persists. + if vim.api.nvim_get_mode().mode == 'c' and not vim.go.wildmode:find('list') then + if vim.tbl_contains(opts.place, 'statusline') or vim.tbl_contains(opts.place, 'winbar') then + vim.cmd('redrawstatus') + elseif vim.tbl_contains(opts.place, 'tabline') then + vim.cmd('redrawtabline') + end end vim.g.actual_curwin = old_actual_curwin