aboutsummaryrefslogtreecommitdiff
path: root/test/functional/plugin/lsp/incremental_sync_spec.lua
diff options
context:
space:
mode:
authorMichael Lingelbach <m.j.lbach@gmail.com>2021-11-18 13:49:46 -0800
committerGitHub <noreply@github.com>2021-11-18 16:49:46 -0500
commitf71be1f87b40bf863b6cf6b4fbcebffdd3297d88 (patch)
tree10c1c3daf69812e5fbaf6a876a4df083bb26260f /test/functional/plugin/lsp/incremental_sync_spec.lua
parentd249e18bbf3454088eddf400b13b353b3ff6d91c (diff)
downloadrneovim-f71be1f87b40bf863b6cf6b4fbcebffdd3297d88.tar.gz
rneovim-f71be1f87b40bf863b6cf6b4fbcebffdd3297d88.tar.bz2
rneovim-f71be1f87b40bf863b6cf6b4fbcebffdd3297d88.zip
fix(lsp): improve incremental sync robustness (#16358)
closes https://github.com/neovim/neovim/issues/16352 * improve handling of multi-byte deletions
Diffstat (limited to 'test/functional/plugin/lsp/incremental_sync_spec.lua')
-rw-r--r--test/functional/plugin/lsp/incremental_sync_spec.lua26
1 files changed, 25 insertions, 1 deletions
diff --git a/test/functional/plugin/lsp/incremental_sync_spec.lua b/test/functional/plugin/lsp/incremental_sync_spec.lua
index 890db4abf5..5dd34e7665 100644
--- a/test/functional/plugin/lsp/incremental_sync_spec.lua
+++ b/test/functional/plugin/lsp/incremental_sync_spec.lua
@@ -297,7 +297,31 @@ describe('incremental synchronization', function()
}
test_edit({"🔥"}, {"x"}, expected_text_changes, 'utf-16', '\n')
end)
- it('deleting a multiple lines containing multibyte characters', function()
+ it('deleting a multibyte character from a long line', function()
+ local expected_text_changes = {
+ {
+ range = {
+ ['start'] = {
+ character = 85,
+ line = 1
+ },
+ ['end'] = {
+ character = 86,
+ line = 1
+ }
+ },
+ rangeLength = 1,
+ text = ''
+ }
+ }
+ local original_lines = {
+ "\\begin{document}",
+ "→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→→",
+ "\\end{document}",
+ }
+ test_edit(original_lines, {"jx"}, expected_text_changes, 'utf-16', '\n')
+ end)
+ it('deleting multiple lines containing multibyte characters', function()
local expected_text_changes = {
{
range = {