enhance: for command ModeChanged event refresh lualine in autocmd context

closes #791
This commit is contained in:
shadmansaleh 2022-08-08 16:08:13 +06:00
parent 5b1dc4da0b
commit de778faf81
1 changed files with 12 additions and 6 deletions

View File

@ -326,12 +326,18 @@ local function refresh(opts)
-- updating statusline in autocommands context seems to trigger 100 different bugs -- updating statusline in autocommands context seems to trigger 100 different bugs
-- lets just defer it to a timer context and update there -- lets just defer it to a timer context and update there
-- workaround for https://github.com/neovim/neovim/issues/15300 -- Since updating stl in command mode doesn't take effect
-- workaround for https://github.com/neovim/neovim/issues/19464 -- refresh ModeChanged command in autocmd context as exception.
-- workaround for https://github.com/nvim-lualine/lualine.nvim/issues/753 -- workaround for
-- workaround for https://github.com/nvim-lualine/lualine.nvim/issues/751 -- https://github.com/neovim/neovim/issues/15300
-- workaround for https://github.com/nvim-lualine/lualine.nvim/issues/755 -- https://github.com/neovim/neovim/issues/19464
if opts.trigger == 'autocmd' then -- https://github.com/nvim-lualine/lualine.nvim/issues/753
-- https://github.com/nvim-lualine/lualine.nvim/issues/751
-- https://github.com/nvim-lualine/lualine.nvim/issues/755
-- https://github.com/neovim/neovim/issues/19472
-- https://github.com/nvim-lualine/lualine.nvim/issues/791
if opts.trigger == 'autocmd'
and vim.v.event.new_mode ~= 'c' then
opts.trigger = 'autocmd_redired' opts.trigger = 'autocmd_redired'
vim.schedule(function() vim.schedule(function()
M.refresh(opts) M.refresh(opts)