diff options
author | hrsh7th <629908+hrsh7th@users.noreply.github.com> | 2023-03-14 20:59:43 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-03-14 04:59:43 -0700 |
commit | 8dde7c907ca9ad365895bded2c2f59e08f65d3ed (patch) | |
tree | e69c38ade53bc9779640ae1f57a97a5873ed2096 /test/functional | |
parent | 06e3ff6671b45ffde8cbfa98ce2743fb9d46319d (diff) | |
download | rneovim-8dde7c907ca9ad365895bded2c2f59e08f65d3ed.tar.gz rneovim-8dde7c907ca9ad365895bded2c2f59e08f65d3ed.tar.bz2 rneovim-8dde7c907ca9ad365895bded2c2f59e08f65d3ed.zip |
fix(lsp): vim.lsp.util.apply_text_edits cursor validation #22636
Problem
Using wrong variable when checking the cursor position is valid or not in
vim.lsp.util.apply_text_edits.
Solution
Use the correct variable.
Diffstat (limited to 'test/functional')
-rw-r--r-- | test/functional/plugin/lsp_spec.lua | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/test/functional/plugin/lsp_spec.lua b/test/functional/plugin/lsp_spec.lua index a6e50ac82c..ddbeef6d84 100644 --- a/test/functional/plugin/lsp_spec.lua +++ b/test/functional/plugin/lsp_spec.lua @@ -1714,6 +1714,9 @@ describe('LSP', function() end) it('fix the cursor col', function() + -- append empty last line. See #22636 + exec_lua('vim.api.nvim_buf_set_lines(...)', 1, -1, -1, true, {''}) + funcs.nvim_win_set_cursor(0, { 2, 11 }) local edits = { make_edit(1, 7, 1, 11, '') @@ -1725,6 +1728,7 @@ describe('LSP', function() 'Third line of text'; 'Fourth line of text'; 'å å ɧ 汉语 ↥ 🤦 🦄'; + ''; }, buf_lines(1)) eq({ 2, 7 }, funcs.nvim_win_get_cursor(0)) end) |