Open stevenxxiu opened 1 month ago
The bufferline issue seems to go away if I use clear_on_bufleave = false
, but now I get errors in Neogit when I quit a diff view:
E5108: Error executing lua vim/_editor.lua:0: nvim_exec2()..BufHidden Autocommands for "*": Vim(append):Error executing lua callback: Vim:E957: Invalid window number
stack traceback:
[C]: in function 'getmatches'
...y/highlight-whitespace/lua/highlight-whitespace/core.lua:103: in function 'save_matches_to_cache_and_clear'
...y/highlight-whitespace/lua/highlight-whitespace/init.lua:37: in function <...y/highlight-whitespace/lua/highlight-whitespace/init.lua:36>
[C]: in function 'nvim_exec2'
vim/_editor.lua: in function 'cmd'
...re/nvim/lazy/neogit/lua/neogit/integrations/diffview.lua:20: in function 'close'
[string ":lua"]:1: in main chunk
stack traceback:
[C]: in function 'nvim_exec2'
vim/_editor.lua: in function 'cmd'
...re/nvim/lazy/neogit/lua/neogit/integrations/diffview.lua:20: in function 'close'
[string ":lua"]:1: in main chunk
Hello @stevenxxiu! I'm glad you continue using the plugin and helping to improve it! Currently, I'm on my full vacation: it means I am going hiking tomorrow and won't be accessible till Aug 6th (No wifi, no mobile network). So until then I won't be able to help you. However, we will definitely try to fix it later.
If you are familiar with the code enough, you can suggest your changes on how to fix the issues above. By the way, clear_on_bufleave = true
should remove HWS highlighting in a window user leaves, when jumping to another one. You can check the code related this part and try to correlate with your traceback
Thanks to you too. I'll see if I can fix some of those issues.
I just realized that the reason my custom background for Markdown files doesn't work anymore, is since vim.api.nvim_win_set_hl_ns()
overrides winhighlight
. This means buffers can no longer have custom highlights.
I'm not sure what the best solution is here. I can't find anything on Treesitter setting a different background color per syntax.
What do you think about having a separate namespace for each syntax, so this is possible?
I also thought of the https://github.com/folke/styler.nvim plugin, but I'm not sure how easy it is to make a syntax that inherits another (I use catppuccin).
I suppose I got the custom highlights to work just by reusing vim.api.nvim_win_set_hl_ns()
:
local highlight_whitespace_core = require('highlight-whitespace.core')
-- ...
vim.api.nvim_set_hl(highlight_whitespace_core.ns_id, 'Normal', { fg = C.text, bg = MARKDOWN_BG })
The latest commit b736461ad6d4ec3fa718d13d3c872a1f7ec5b75c broke my config quite a bit.
I have a custom background color for Markdown files, set by:
Now this no longer works, as highlight-whitespace is overriding it. Instead I have to do:
Another bug is when I use bufferline, picking a tab to jump to sometimes causes errors: