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

Incorrect syntax highlighting with CRLF line endings #10992

Closed
chtenb opened this issue Jun 19, 2024 · 1 comment · Fixed by #6417
Closed

Incorrect syntax highlighting with CRLF line endings #10992

chtenb opened this issue Jun 19, 2024 · 1 comment · Fixed by #6417
Labels
A-tree-sitter Area: Tree-sitter C-bug Category: This is a bug

Comments

@chtenb
Copy link
Contributor

chtenb commented Jun 19, 2024

Summary

It seems that some languages exhibit incorrect syntax highlighting when looking at a file with crlf line endings. I've seen this with nushell and koka, two languages I use personally.

I originally created an issue in the koka treesitter repo, but the current hypothesis seems to be that it is a generic Helix problem:
mtoohey31/tree-sitter-koka#3

Reproduction Steps

I tried this:

  1. hx
  2. Set language to koka :set-language koka
  3. Set line endings to CRLF :line-ending crlf
  4. Insert the following snippet
// Generate True with probability k/n
fun gen-bool(k: int, n: int) : random bool
  rnd-int32(0, n) < k

I expected this to happen:
image

Instead, this happened:
image

Helix log

No response

Platform

Windows

Terminal Emulator

wezterm 20240520-135708-b8f94c47

Installation Method

source

Helix Version

reproducible with several recent versions, including origin/master

@chtenb chtenb added the C-bug Category: This is a bug label Jun 19, 2024
@the-mikedavis
Copy link
Member

Looks like 7ae49de (#6417) will fix this, I can't reproduce after that commit.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-tree-sitter Area: Tree-sitter C-bug Category: This is a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants