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

Draw undercurls more nicely like VTE does #14

Closed
Lyude opened this issue Dec 13, 2021 · 1 comment
Closed

Draw undercurls more nicely like VTE does #14

Lyude opened this issue Dec 13, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@Lyude
Copy link
Owner

Lyude commented Dec 13, 2021

The way that neovim-gtk renders undercurls isn't ideal, and could be made to look nicer as @bellini666 pointed out in #11 by mimicking what VTE does for undercurl rendering, so as to look like this:

image

Instead of this:

image

In order to accomplish this, we need to make it so that we draw underlines and undercurls from start to finish in one go - instead of doing it per cell like we're presently doing.

@Lyude Lyude added the enhancement New feature or request label Dec 13, 2021
@Lyude
Copy link
Owner Author

Lyude commented Dec 17, 2022

I'm going to close this as done for the time being, as GTK4 changed how we actually do underline rendering. Since 441ee7e, we've started combining various formatting operations across cells where they're the same. This means for any continuous vertical formatting operation, like an undercurl, we will always the whole line at once with a single render node.

While we no longer do true undercurls like pictured here, the only reason we don't is because GTK4 doesn't yet have a nice API we could really use to reproduce this kind of effect easily. Ideally we'd have some sort of path API, but following discussions with folks from GTK+ like Company they haven't yet had a strong enough need to add one. We could do so through cairo, but that means we're potentially mixing CPU and GPU rendering and that's a bit of a shame. In the future though, I'll look into doing this through some potential future path API in snapshots or just using a GL shader. Particularly since at some point nvim gained the concept of having separate underdot and undercurl formatting types, and ideally I'd like to be faithful to those being displayed as two distinct formatting operations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant