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

Some URLs aren't fully stylized as links #13285

Open
Rudxain opened this issue Apr 6, 2025 · 1 comment
Open

Some URLs aren't fully stylized as links #13285

Rudxain opened this issue Apr 6, 2025 · 1 comment
Labels
C-bug Category: This is a bug

Comments

@Rudxain
Copy link
Contributor

Rudxain commented Apr 6, 2025

Summary

Some URLs are only colored and/or underlined on the left-side (prefix), if the right-side (suffix) contains unexpected (but valid) chars.

This only happens when the URL is part of a comment. I can repro with the following langs:

  • Rust
  • JS/TS
  • Java
  • Python

The link is rendered exactly the same. It's not an LSP issue, as I don't have Java or Py lang-servers installed.

Weirdly, markdown hyperlinks ("anchors") are stylized properly.

It's not a terminal issue, as the terminal recognizes the full URL when hovering the mouse cursor.

gf motion works properly (includes full URL), so it really is only a style issue

Reproduction Steps

I tried this:

  1. hx
  2. paste // https://doc.rust-lang.org/std/boxed/struct.Box.html#impl-IntoIterator-for-Box%3C%5BI%5D,+A%3E
  3. :set-language <anything I mentioned, except Py or shell>

I expected this to happen:
The full URL is white (blue, with my fav theme) and underlined

Instead, this happened:
The URL is white and underlined, until the comma. After the , it looks like plain-text (gray)

Helix log

~/.cache/helix/helix.log
please provide a copy of `~/.cache/helix/helix.log` here if possible, you may need to redact some of the lines

Platform

Linux

Terminal Emulator

GNOME Terminal 3.56.0

Installation Method

cargo install --config 'build.rustflags="-C target-cpu=native"' --path helix-term --locked

Helix Version

helix 25.01.1 (7ebf650)

@Rudxain Rudxain added the C-bug Category: This is a bug label Apr 6, 2025
@nik-rev
Copy link
Contributor

nik-rev commented Apr 7, 2025

Helix uses 2 different tree-sitter parsers.
For markdown, it's https://github.com/tree-sitter-grammars/tree-sitter-markdown
For comments, it is https://github.com/stsewd/tree-sitter-comment

These two parsers may not necessarily parse URLs in the same way. it would be more appropriate to first try updating the parser (sometimes they're out of date and the issue could have been fixed already), or making an issue in the appropriate repo

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

No branches or pull requests

2 participants