diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2024-02-24 19:21:57 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-02-24 19:21:57 -0600 |
commit | 2e1f5055acdef650c27efc4afdf8606037ec021b (patch) | |
tree | 3c45462de95f9e63a902ca57813cb4440dfdf017 /runtime/lua/vim/lsp.lua | |
parent | c2ddef30e743d8c1de6d960bf230b8646cb49c7c (diff) | |
download | rneovim-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.lua | 2 |
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 |