We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent bccec33 commit 42f244bCopy full SHA for 42f244b
runtime/lua/vim/lsp/_folding_range.lua
@@ -265,7 +265,7 @@ end
265
266
---@param client_id integer
267
function State:on_attach(client_id)
268
- self.client_state = {}
+ self.client_state[client_id] = {}
269
self:refresh(vim.lsp.get_client_by_id(client_id))
270
end
271
@@ -344,7 +344,9 @@ function M.foldexpr(lnum)
344
if not vim.lsp._capability.is_enabled('folding_range', { bufnr = bufnr }) then
345
-- `foldexpr` lead to a textlock, so any further operations need to be scheduled.
346
vim.schedule(function()
347
- vim.lsp._capability.enable('folding_range', true, { bufnr = bufnr })
+ if api.nvim_buf_is_valid(bufnr) then
348
+ vim.lsp._capability.enable('folding_range', true, { bufnr = bufnr })
349
+ end
350
end)
351
352
0 commit comments