All contributions

vscode-neovim/vscode-neovim

vscode-neovim

A VS Code extension where the editing is done by a real Neovim, for people who want Vim mode with their own configuration.

Language
TypeScript
GitHub stars
7,764
Merged changes
1
Project site
marketplace.visualstudio.com

What we changed

Visual mode selections no longer cut emoji and other characters outside the Unicode BMP in half.

What this work shows

  • UTF-8, UTF-16 and surrogate pairs
  • Lua in Neovim
  • VS Code extension integration tests
  • LSP ranges
What was broken

A selection split an emoji in half

When turning the inclusive end of a selection into an exclusive one, lsp_range() added a single UTF-16 unit. An emoji or a character such as 𝕜 takes two, so a visual mode selection ended halfway through a surrogate pair.

How we fixed it

A step over the whole character

The end of the selection first moves past the whole character in bytes with vim.str_utf_end, and only then is the column converted to UTF-16. Three new integration tests check selections over a single, consecutive and mixed non-BMP characters.

#2683

Merged change

1 23 September 2026

What it taught us

VS Code counts columns in UTF-16 units and Neovim in UTF-8 bytes, so every offset has to move by a whole character, with the units converted only afterwards. We back such a fix with integration tests in a real editor.

More about this technology: TypeScript, React and Node

Other projects we write code for

Describe your project.

A free quote comes back within an hour during working hours.