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

perf: use blend hl groups #24

Merged
merged 3 commits into from
Nov 27, 2024
Merged

perf: use blend hl groups #24

merged 3 commits into from
Nov 27, 2024

Conversation

folke
Copy link
Contributor

@folke folke commented Nov 27, 2024

Use the blend property of hl groups to prevent needing to set winblend on every character draw.

Works with or without legacy symbols.

Builds on the wins PR. Actual changes: 335ae3f

@folke
Copy link
Contributor Author

folke commented Nov 27, 2024

rebased on main

@sphamba
Copy link
Owner

sphamba commented Nov 27, 2024

Curiously, this way of blending does not work exactly as expected (with or without legacy symbols). There is a visible difference between regular and inverted symbols.

On main:
main

On this PR:
pr

@folke
Copy link
Contributor Author

folke commented Nov 27, 2024

oh right, probably because it blends to the cursorline color instead of the normal bg color...

@folke
Copy link
Contributor Author

folke commented Nov 27, 2024

although, there's no cursorline in your screenshot...

@sphamba
Copy link
Owner

sphamba commented Nov 27, 2024

Yep I thought about it afterwards, so I removed the cursorline bg to be sure, and still have the issue.
In neovim's source code, it seems like the blending of fg and bg colors are done differently, so I don't know if we can elegantly resove this issue

@folke
Copy link
Contributor Author

folke commented Nov 27, 2024

can reproduce it now. Will check.
btw, doesn't pretty much every font support those legacy block symbols? Especially Nerd Fonts?

@sphamba
Copy link
Owner

sphamba commented Nov 27, 2024

can reproduce it now. Will check. btw, doesn't pretty much every font support those legacy block symbols? Especially Nerd Fonts?

I tried several ones lately (Fira, Iosekva, VictorMono), and the only one that had them was Cascadia Code NF. And it looks weird with Cascadia Code (the legacy symbols have weird spacing)
image

What font are you using?

@sphamba
Copy link
Owner

sphamba commented Nov 27, 2024

btw, I use opts = { trailing_stiffness = 0 } to debug now

@folke
Copy link
Contributor Author

folke commented Nov 27, 2024

I'm using regular Fira Code, but my terminal uses Nerd Font Symbols as a fallback.

image

Just to be clear, which of the two is actually correct? Top or bottom? :)

@sphamba
Copy link
Owner

sphamba commented Nov 27, 2024

Ah I don't think I can get fallback fonts on my terminal (windows terminal), so I use nerd font files directly (and they don't have the legacy symbols...).

I'd prefer to have the one without the difference of shade between the upper and lower parts of the smear. See with color_levels = 1, no CursorLine:

main:
image

pr:
image

@folke
Copy link
Contributor Author

folke commented Nov 27, 2024

ok, should be fixed now!

@sphamba sphamba merged commit 1631f07 into sphamba:main Nov 27, 2024
1 check passed
@sphamba sphamba added the performance Something is slow label Nov 28, 2024
@sphamba sphamba changed the title perf: use blnd hl groups perf: use blend hl groups Nov 28, 2024
@rachartier
Copy link

rachartier commented Nov 28, 2024

Ah I don't think I can get fallback fonts on my terminal (windows terminal), so I use nerd font files directly (and they don't have the legacy symbols...).

Hi, just for your information, you can now have fallback fonts in Windows Terminal (check: pull/16821) You only need to separate different fonts with a comma! Tried on Terminal Windows Version : 1.21.3231.0, Win11

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Something is slow
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants