Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Accepting a cached UTF-16/UTF-32 completion after typing
三can turn{三}into{三角洲, deleting the closing brace. Cursor compensation currently adds a byte delta to a range expressed in the client's encoding.Preserve the request-time line alongside each item's position and compute the cursor delta in the client's encoding before converting the edit to UTF-8. This also handles deletions and IME replacements such as
san→三, where the byte column does not change. Preserve the original line through LSP cache reuse and strip the internal metadata beforecompletionItem/resolve. Byte-based edits retain their existing path, and conversion still happens after compensation to avoid premature clamping on shortened lines.Closes #2650.
Validation:
8219b58and passes with this change.stylua --check .andgit diff --checkpass.Run the regression cases with Neovim >= 0.11 and a sibling
blink.libcheckout (tested with Neovim0.12.5+editor-fixes.6and blink.libfd9a48e):nvim --headless -u NONE --cmd 'set rtp+=.,../blink.lib' -l tests/text_edits.luaThe runner stubs only the LSP client; no language server, IME, snippet engine, or native fuzzy build is required. Local checks ran under a 512 MiB cgroup limit with swap disabled.