b0o / incline.nvim

🎈 Floating statuslines for Neovim, winbar alternative
MIT License
759 stars 14 forks source link

How to trigger a rerender? #58

Closed tim-kilian closed 5 months ago

tim-kilian commented 5 months ago

When I reset my hlsearch with :nohlsearch, incline is not updating until I move my cursor. My current fix is to add a jk movement after :nohlsearch, but then the cursor moves and flickers after executing my command. I need a way to rerender incline. How do I do that?

b0o commented 5 months ago

I've added an incline.refresh() function:

require('incline').refresh()

Does running it after :nohlsearch work for you?

tim-kilian commented 5 months ago

Yes, it does. Now it updates without my movement hack! Thank you very much! Really good work and a awesome plugin!

vim.keymap.set('n', '<leader>/', function()
  vim.cmd('nohlsearch')
  require('incline').refresh()
end, { desc = 'Hide [/] Search' })