Open camoz opened 4 months ago
searchcount
/a<CR>
<C-l>
searchcount component becomes instantly invisible.
searchcount component does not become instantly invisible. It becomes invisible after the remaining time until lualine refreshes.
Lualine default config with following changes:
require('lualine').setup { options = { icons_enabled = true, theme = 'auto', component_separators = { left = '', right = ''}, section_separators = { left = '', right = ''}, disabled_filetypes = { statusline = {}, winbar = {}, }, ignore_focus = {}, always_divide_middle = true, globalstatus = false, refresh = { statusline = 3000, tabline = 1000, winbar = 1000, } }, sections = { lualine_a = {'mode'}, lualine_b = {'branch', 'diff', 'diagnostics'}, lualine_c = {'filename'}, lualine_x = {'searchcount', 'encoding', 'fileformat', 'filetype'}, lualine_y = {'progress'}, lualine_z = {'location'} }, inactive_sections = { lualine_a = {}, lualine_b = {}, lualine_c = {'filename'}, lualine_x = {'location'}, lualine_y = {}, lualine_z = {} }, tabline = {}, winbar = {}, inactive_winbar = {}, extensions = {} }
Neovim 0.10 by default maps <C-l> to <Cmd>nohlsearch|diffupdate|normal! <C-L><CR>, see :nmap <C-l> and :help default-mappings.
<Cmd>nohlsearch|diffupdate|normal! <C-L><CR>
:nmap <C-l>
:help default-mappings
Workaround:
-- Overwrite neovim's <C-l> mapping using : instead of <Cmd> vim.keymap.set('n', '<C-l>', ':nohlsearch|diffupdate|normal! <C-L><CR>')
I think this works because :, unlike <Cmd>, triggers a mode change, and lualine refreshes on ModeChanged.
:
<Cmd>
ModeChanged
Self Checks
How to reproduce the problem
searchcount
component/a<CR>
searchcount
component becomes visible<C-l>
to clear highlighting of current search resultsExpected behaviour
searchcount
component becomes instantly invisible.Actual behaviour
searchcount
component does not become instantly invisible. It becomes invisible after the remaining time until lualine refreshes.Minimal config to reproduce the issue
Lualine default config with following changes:
searchcount
component added to section lualine_xAdditional information
Neovim 0.10 by default maps
<C-l>
to<Cmd>nohlsearch|diffupdate|normal! <C-L><CR>
, see:nmap <C-l>
and:help default-mappings
.Workaround:
I think this works because
:
, unlike<Cmd>
, triggers a mode change, and lualine refreshes onModeChanged
.