mirror of
https://github.com/neovim/neovim.git
synced 2026-08-01 05:09:08 +00:00
fix(lsp): request semantic tokens in BufWinEnter #40513
Problem: A previous refactor removed the BufWinEnter autocmd that initiated a token request. When an LSP server sends a refresh notification, then buffers that aren't shown in any window lost their only trigger to request new tokens. Solution: Add the BufWinEnter autocmd back which simply requests tokens for all clients attached to the buffer.
This commit is contained in:
@@ -245,6 +245,14 @@ function STHighlighter:on_attach(client_id)
|
||||
end,
|
||||
})
|
||||
|
||||
api.nvim_create_autocmd('BufWinEnter', {
|
||||
buf = self.bufnr,
|
||||
group = self.augroup,
|
||||
callback = function()
|
||||
self:send_request()
|
||||
end,
|
||||
})
|
||||
|
||||
if state.supports_range then
|
||||
api.nvim_create_autocmd('WinScrolled', {
|
||||
buf = self.bufnr,
|
||||
|
||||
Reference in New Issue
Block a user