Fix moving to next word boundary with multi-byte characters#123
Merged
nathansobo merged 1 commit intomainfrom Aug 5, 2021
Merged
Fix moving to next word boundary with multi-byte characters#123nathansobo merged 1 commit intomainfrom
nathansobo merged 1 commit intomainfrom
Conversation
Previously, for a given point, we would create a char iterator at the start of the row and the skip `column` characters. This is however incorrect because display points are expressed in bytes, and so we could park the anchor midway through a multi-byte character. This commit fixes the issue by switching `DisplayMap::chars_at` to take a point instead and skipping characters correctly when a point with a non-zero column is provided.
Contributor
|
Thanks for fixing this ⚡. |
br-schneider
added a commit
to br-schneider/zed
that referenced
this pull request
Feb 6, 2026
HTML character references (e.g., `·`, `'`, `&zed-industries#123;`) are parsed by tree-sitter but not captured by any highlight query, so they render as unhighlighted plain text. This adds highlight captures for: - `html_character_reference` in TSX and JavaScript (JSX context) - `entity` in HTML All three are captured as `@string.special`, which is already styled by the built-in themes.
br-schneider
added a commit
to br-schneider/zed
that referenced
this pull request
Feb 22, 2026
HTML character references (e.g., `·`, `'`, `&zed-industries#123;`) are parsed by tree-sitter but not captured by any highlight query, so they render as unhighlighted plain text. This adds highlight captures for: - `html_character_reference` in TSX and JavaScript (JSX context) - `entity` in HTML All three are captured as `@string.special`, which is already styled by the built-in themes.
yeskunall
pushed a commit
that referenced
this pull request
Feb 23, 2026
) HTML character references like `·`, `'`, and `{` are correctly parsed by tree-sitter as named nodes (`html_character_reference` in TSX/JavaScript, `entity` in HTML), but no highlight query captures them. This means they render as plain, unhighlighted text in the editor. This PR adds one-line highlight captures for each: - **TSX** (`crates/languages/src/tsx/highlights.scm`): `(html_character_reference) @string.special` - **JavaScript** (`crates/languages/src/javascript/highlights.scm`): `(html_character_reference) @string.special` - **HTML** (`extensions/html/languages/html/highlights.scm`): `(entity) @string.special` `@string.special` is already styled by all built-in themes (One Dark, Ayu, Gruvbox, etc.), so no theme changes are needed. Release Notes: - Added syntax highlighting for HTML character references (`·`, `'`, `{`, etc.) in TSX, JavaScript, and HTML files.
Anthony-Eid
pushed a commit
to bobbymannino/zed
that referenced
this pull request
Feb 25, 2026
…-industries#48629) HTML character references like `·`, `'`, and `&zed-industries#123;` are correctly parsed by tree-sitter as named nodes (`html_character_reference` in TSX/JavaScript, `entity` in HTML), but no highlight query captures them. This means they render as plain, unhighlighted text in the editor. This PR adds one-line highlight captures for each: - **TSX** (`crates/languages/src/tsx/highlights.scm`): `(html_character_reference) @string.special` - **JavaScript** (`crates/languages/src/javascript/highlights.scm`): `(html_character_reference) @string.special` - **HTML** (`extensions/html/languages/html/highlights.scm`): `(entity) @string.special` `@string.special` is already styled by all built-in themes (One Dark, Ayu, Gruvbox, etc.), so no theme changes are needed. Release Notes: - Added syntax highlighting for HTML character references (`·`, `'`, `&zed-industries#123;`, etc.) in TSX, JavaScript, and HTML files.
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.
Previously, for a given point, we would create a char iterator at the start of the row and then skip
columncharacters. This ishowever incorrect because display points are expressed in bytes, and so we could park the anchor midway through a multi-byte character.
This commit fixes the issue by switching
DisplayMap::chars_atto take a point instead and skipping characters correctly when a point with a non-zero column is provided./cc: @nathansobo @maxbrunsfeld