From f71be1f87b40bf863b6cf6b4fbcebffdd3297d88 Mon Sep 17 00:00:00 2001 From: Michael Lingelbach Date: Thu, 18 Nov 2021 13:49:46 -0800 Subject: fix(lsp): improve incremental sync robustness (#16358) closes https://github.com/neovim/neovim/issues/16352 * improve handling of multi-byte deletions --- .../plugin/lsp/incremental_sync_spec.lua | 26 +++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) (limited to 'test/functional/plugin') 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 = { -- cgit