Skip to content

Commit c1c95d5

Browse files
committed
chore: vim.lsp.semantic_tokens.{start,stop} added support for bufnr = 0
1 parent 298f242 commit c1c95d5

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

lua/astrolsp/toggles.lua

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,7 @@ function M.buffer_semantic_tokens(bufnr, silent)
6666
local toggled = false
6767
for _, client in ipairs(vim.lsp.get_clients { bufnr = bufnr }) do
6868
if client:supports_method("textDocument/semanticTokens/full", bufnr) then
69-
-- HACK: `semantic_tokens.start/stop` don't support 0 for current buffer
70-
local real_bufnr = bufnr == 0 and vim.api.nvim_get_current_buf() or bufnr
71-
vim.lsp.semantic_tokens[vim.b[bufnr].semantic_tokens and "start" or "stop"](real_bufnr, client.id)
69+
vim.lsp.semantic_tokens[vim.b[bufnr].semantic_tokens and "start" or "stop"](bufnr, client.id)
7270
vim.lsp.semantic_tokens.force_refresh(bufnr)
7371
toggled = true
7472
end

0 commit comments

Comments
 (0)