-
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
don't manually grapheme align ts highlights #10310
Merged
Merged
Conversation
This file contains 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
pascalkuthe
added
C-bug
Category: This is a bug
E-easy
Call for participation: Experience needed to fix: Easy / not much
A-helix-term
Area: Helix term improvements
S-waiting-on-review
Status: Awaiting review from a maintainer.
C-perf
labels
Apr 8, 2024
archseer
reviewed
Apr 9, 2024
pascalkuthe
force-pushed
the
non_unicode_crash
branch
from
April 9, 2024 10:00
28f6e30
to
88f456a
Compare
pascalkuthe
force-pushed
the
non_unicode_crash
branch
from
April 9, 2024 21:14
bb63ee9
to
d31c09f
Compare
the-mikedavis
approved these changes
Apr 9, 2024
postsolar
pushed a commit
to postsolar/helix
that referenced
this pull request
Apr 20, 2024
mtoohey31
pushed a commit
to mtoohey31/helix
that referenced
this pull request
Jun 2, 2024
Vulpesx
pushed a commit
to Vulpesx/helix
that referenced
this pull request
Jun 7, 2024
Chirikumbrah
pushed a commit
to Chirikumbrah/helix
that referenced
this pull request
Jun 15, 2024
smortime
pushed a commit
to smortime/helix
that referenced
this pull request
Jul 10, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-helix-term
Area: Helix term improvements
C-bug
Category: This is a bug
C-perf
E-easy
Call for participation: Experience needed to fix: Easy / not much
S-waiting-on-review
Status: Awaiting review from a maintainer.
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.
Closes #6645
I have known the root cause of #6645 for a while: The c grammar has a bug where it sometimes creates non-grapheme aligned highlight spans when cealing with unicode characters like emojois.
This caused crashes because our grapheme alignment code couldn't deal with non-char aligned offsets. I think that is the right (potentially only valid) choice for doing grapheme alignment.
In our case it was unfortunate as it leads to crashes. I also wanted to get rid of this grapheme alignment anyway because we already render the text one grapheme at a time, so it's really unnecessary to do this. However, in the past it wasn't possible to remove the alignment because the additional highlight iterators merged on top of the base iterator were using char indexing/grapheme aligned indexes. Just switching the TS iterator would have caused highlighting bugs.
However, recently the overlay and base highlights were decoupled so now the base highlights are seperate, and it was possible to convert the base iterator to using byte indexing instead