Closed dmmulroy closed 1 year ago
Hi this is a new neovim feature called semantic tokens which add addition highlights using LSP servers, refer to :h lsp-semantic-highlight for more information
This is the same behavior in tokyonight, nightfox, kanawaga, etc
If you wish to disable this behavior you can add this code (Taken from :h lsp-semantic-highlight)
-- Hide semantic highlights for functions
vim.api.nvim_set_hl(0, '@lsp.type.function', {})
-- Hide all semantic highlights
for _, group in ipairs(vim.fn.getcompletion("@lsp", "highlight")) do
vim.api.nvim_set_hl(0, group, {})
end
Ah, thank you this worked! Do you know if it's the intended behavior to reapply highlights in the way that it current is when using the format function?
It's "intended" for now. However, languages like C/C++ doesn't have this flickering issue, there are efforts upstream to address this :)
@nullchilly would you happen to have any links to issues for said upstream so I can track?
Not an actual fix, but I disabled formating from lua_ls
and instead used the one from null_ls.builtins.formatting.stylua
and the highlights are not being removed now
null_ls.setup({
-- ...,
sources = {
-- ...,
null_ls.builtins.formatting.stylua,
}
})
-- formatting with:
vim.lsp.buf.format({
async = true,
filter = function(client)
return client.name ~= "lua_ls"
end,
})
Description
When invoking
vim.lsp.buf.format
highlights + italics are temporarily removed. This is only happening for mycatppuccin
theme and it seems to only occur when an lsp is connected and running.https://user-images.githubusercontent.com/2755722/236859390-2c942267-c6ba-4634-8e85-509f0ec1a9c9.mov
Neovim version
Terminal and multiplexer
kitty: Version 0.27.1 (0.27.1)
Catppuccin version / branch / rev
main
Steps to reproduce
Expected behavior
No highlights/text should change
Actual behavior
Italics and highlights are removed and reapplied
Repro