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

Sometimes when hx is started, syntax highlighting is incomplete #2484

Closed
thomas-profitt opened this issue May 16, 2022 · 2 comments · Fixed by #3275
Closed

Sometimes when hx is started, syntax highlighting is incomplete #2484

thomas-profitt opened this issue May 16, 2022 · 2 comments · Fixed by #3275
Labels
A-helix-term Area: Helix term improvements C-bug Category: This is a bug

Comments

@thomas-profitt
Copy link

Summary

When running hx repeatedly to open the same file, ~4 out of every 10 sessions will start with incorrect syntax highlighting:
Screenshot_2022-05-16_14-29-53

I've seen this happen with both .rb and .ex files. I expect it happens with other file types too, but don't know if I've noticed it.

In a hx session that started with this bug, :open-ing a new file, even a file of a different language, does not fix the highlighting. Nor does running :set-language, :theme, or anything else I tried. hx must be restarted.

Reproduction Steps

I tried this:

hx whatever.rb, hx whatever.rb, hx whatever.rb, hx whatever.rb, hx whatever.rb, either in sequence or in separate terminal emulator windows

I expected this to happen:

Each of the 5 hx invocations starts Helix, with the same color theme, and they all look the same.

Instead, this happened:

One or more of the running hx sessions doesn't correctly highlight these specific parts of the code. Each time the bug happens, it's these same parts that aren't properly highlighted.

Helix log

(whether a hx session starts with this bug or not, log output is the same for me.)

Platform

Linux (amd64)

Terminal Emulator

Affects both gnome-terminal and cool-retro-term

Helix Version

helix 22.05-dev (cc68fa8)

@thomas-profitt thomas-profitt added the C-bug Category: This is a bug label May 16, 2022
@the-mikedavis the-mikedavis added the A-helix-term Area: Helix term improvements label May 16, 2022
@the-mikedavis
Copy link
Member

I think it might have something to do with the fallback behavior for themes but I haven't investigated much - I have also seen this happening with Elixir files.

@archseer
Copy link
Member

I suspect it could be the query analysis inside tree-sitter being non-deterministic somehow. I've seen this with TODO comment highlights in typescript where it would highlight them incorrectly sometimes

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
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants