aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp.lua
diff options
context:
space:
mode:
authorGregory Anders <8965202+gpanders@users.noreply.github.com>2024-02-24 19:21:57 -0600
committerGitHub <noreply@github.com>2024-02-24 19:21:57 -0600
commit2e1f5055acdef650c27efc4afdf8606037ec021b (patch)
tree3c45462de95f9e63a902ca57813cb4440dfdf017 /runtime/lua/vim/lsp.lua
parentc2ddef30e743d8c1de6d960bf230b8646cb49c7c (diff)
downloadrneovim-2e1f5055acdef650c27efc4afdf8606037ec021b.tar.gz
rneovim-2e1f5055acdef650c27efc4afdf8606037ec021b.tar.bz2
rneovim-2e1f5055acdef650c27efc4afdf8606037ec021b.zip
fix(lsp): add assertion for explicit bufnr in apply_text_edits (#27614)
Assert that the buffer number passed to apply_text_edits is fully resolved (not 0 or null). Pass the known buffer number to apply_text_edits from lsp.formatexpr().
Diffstat (limited to 'runtime/lua/vim/lsp.lua')
-rw-r--r--runtime/lua/vim/lsp.lua2
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/lua/vim/lsp.lua b/runtime/lua/vim/lsp.lua
index 689d942d72..3a74c3ee90 100644
--- a/runtime/lua/vim/lsp.lua
+++ b/runtime/lua/vim/lsp.lua
@@ -1280,7 +1280,7 @@ function lsp.formatexpr(opts)
local response =
client.request_sync(ms.textDocument_rangeFormatting, params, timeout_ms, bufnr)
if response and response.result then
- lsp.util.apply_text_edits(response.result, 0, client.offset_encoding)
+ lsp.util.apply_text_edits(response.result, bufnr, client.offset_encoding)
return 0
end
end