Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Text edit fails with unicode chars #188

Closed
strash opened this issue Oct 25, 2024 · 0 comments
Closed

Text edit fails with unicode chars #188

strash opened this issue Oct 25, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@strash
Copy link

strash commented Oct 25, 2024

I'm getting this error:

Error executing vim.schedule lua callback: .../neovim/0.10.2_1/share/nvim/runtime/lua/vim/lsp/util.lua:483: index out of range
stack traceback:
        [C]: in function 'get_line_byte_from_position'
        .../neovim/0.10.2_1/share/nvim/runtime/lua/vim/lsp/util.lua:483: in function 'apply_text_edits'
        .../nvim/lazy/blink.cmp/lua/blink/cmp/accept/text-edits.lua:34: in function 'apply_text_edits'
        .../share/nvim/lazy/blink.cmp/lua/blink/cmp/accept/init.lua:34: in function <.../share/nvim/lazy/blink.cmp/lua/blink/cmp/accept/init.lua:6>
        ...im/lazy/blink.cmp/lua/blink/cmp/windows/autocomplete.lua:173: in function 'accept'
        .../.local/share/nvim/lazy/blink.cmp/lua/blink/cmp/init.lua:142: in function <.../.local/share/nvim/lazy/blink.cmp/lua/blink/cmp/init.lua:142>

I assume it's because you're treating characters as is and not as unicode symbols.

Steps to reproduce

  • create a string with non-latin symbols (this is important)
  • place the cursor at the end of the string
  • trigger the completion window
  • accept the completion

Example

Screen.Recording.2024-10-25.at.10.18.34.mov
@Saghen Saghen changed the title [BUG] index out of range (unicode related) Text edit fails with unicode chars Oct 25, 2024
@Saghen Saghen added the bug Something isn't working label Oct 25, 2024
@Saghen Saghen closed this as completed in 2e37993 Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants