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

Add option for not render ligatures under cursor #2181

Closed
huibosa opened this issue Jun 25, 2022 · 2 comments
Closed

Add option for not render ligatures under cursor #2181

huibosa opened this issue Jun 25, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@huibosa
Copy link

huibosa commented Jun 25, 2022

I've thought It would be nice to add two options:

  • Not render ligatures under cursor
  • Not render ligatures under cursor line

Not render ligatures under cursor

image

Not render ligatures under cursor line

image

@huibosa huibosa added the enhancement New feature or request label Jun 25, 2022
@wez
Copy link
Owner

wez commented Jun 26, 2022

I'm hesitant to add this because:

  • BIDI:
    • requires that an entire "paragraph" be considered together when it comes to shaping
    • Forcing ligatures off at the cursor position introduces an artificial break for shaping purposes
    • The break could result in incorrect BIDI and incorrect shaping especially for arabic text
    • A secondary consequence is that mapping post-BIDI text for selection purposes (while not currently implemented) would also be broken
  • Ignoring BIDI:
    • Shaping is one of the most expensive things we do when it comes to computing display presentation
    • Changing shaping properties based on the cursor position requires recomputing the shaping info for both the prior and the new cursor position on each cursor movement, resulting in a performance penalty
    • Performance of cursor movement, especially in nvim, is a frequently reported issue against wezterm

Implementing options for this sort of thing increases the complexity of the code and support burden and I'm not convinced that it is worth the effort; in my opinion, I think people either like ligatures and leave them on, or don't like them and turn them off. Aside from perhaps a few cases where you might need to learn the ligatures in a new font, I don't think there are many situations where you need to quickly switch between both.

https://wezfurlong.org/wezterm/config/lua/window/set_config_overrides.html has an example that shows how to make a key assignment that toggles ligatures for the window that I think is a reasonable option for those that do need to do that.

@wez wez closed this as not planned Won't fix, can't repro, duplicate, stale Feb 7, 2023
@github-actions
Copy link
Contributor

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues. If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 10, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants