---
title: "vscode-neovim: selecting emoji and UTF-16 in VS Code"
description: "A fix in vscode-neovim in Lua and TypeScript: visual mode selections no longer cut emoji and other non-BMP characters in the middle of a surrogate pair."
url: "https://vulcode.com/en/opensource/contributions/vscode-neovim"
lang: "en"
---

[All contributions](https://vulcode.com/en/opensource/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.

[See the repository](https://github.com/vscode-neovim/vscode-neovim) [All contributions](https://vulcode.com/en/opensource/contributions)

- **Language**: TypeScript
- **GitHub stars**: 7,764
- **Merged changes**: 1
- **Project site**: [marketplace.visualstudio.com](https://marketplace.visualstudio.com/items?itemName=asvetliakov.vscode-neovim)

## 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](https://github.com/vscode-neovim/vscode-neovim/pull/2683)

## Merged change

1 23 September 2026

- [01 #2683Merged 23 September 2026 Keep visual selections whole over characters outside the BMP](https://github.com/vscode-neovim/vscode-neovim/pull/2683)

## 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](https://vulcode.com/en/technologies/typescript-react-and-node)

## Other projects we write code for

- [**Material UI** JavaScript · 99,391 stars A React component library that implements Google's Material Design: ready-made text fields, selects, buttons and other interface elements.](https://vulcode.com/en/opensource/contributions/material-ui)

- [**Grafana** TypeScript · 78,050 stars An open observability and data visualisation platform that shows metrics, logs and traces from Prometheus, Loki, Elasticsearch, PostgreSQL and many other sources on dashboards.](https://vulcode.com/en/opensource/contributions/grafana)

- [**Marked** TypeScript · 37,323 stars A fast Markdown parser and compiler to HTML, written in TypeScript and following CommonMark and GitHub Flavored Markdown.](https://vulcode.com/en/opensource/contributions/marked)

- [**Autoprefixer** JavaScript · 22,197 stars A PostCSS plugin that adds browser prefixes to CSS based on Can I Use data, including the -ms-grid syntax for CSS Grid layouts.](https://vulcode.com/en/opensource/contributions/autoprefixer)

- [**Lichess** TypeScript · 19,013 stars The lichess.org chess server: free, ad-free and open source, focused on real-time play. The back end is written in Scala, the interface in TypeScript.](https://vulcode.com/en/opensource/contributions/lichess)

- [**compromise** JavaScript · 12,176 stars A natural language processing library in JavaScript: it splits text into sentences and words, tags parts of speech, conjugates verbs and inflects nouns, and reads dates through a plugin. It runs in the browser and in Node.js.](https://vulcode.com/en/opensource/contributions/compromise)

## Describe your project.

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

### Rather skip the form?

Ask in the chat or write to us directly.

Open the chat

- **Email**: [hello@vulcode.com](mailto:hello@vulcode.com)
- **Phone**: [+48 576 043 920](tel:+48576043920)
- **Discord**: [discord.gg/vulcode](https://discord.gg/vulcode)
