Skip to content

Do not render ligatures under cursor (optionally?) #461

Description

@max-baz

I'm playing with font ligatures using Fira Code, it is fun to see them rendered and they convey a meaning quite clearly, however it is sometimes confusing to actually edit the rendered ligature.

For example, looking at this, the meaning is clear:

image

However, what's not immediately obvious is what will happen if I press Del or Backspace in this case:

image

In fact, in this particular case the code is:

if (a !== b) {

What I suggest to do is to not render a ligature if a cursor is currently over it, just render !==.
Then it is very obvious what Del or Backspace will do 🙂

I guess it should be relatively easy to achieve, because a ligature always takes the same number of cells as all of the the underlying "raw" characters.

I have seen people express this opinion for font creators (e.g. be5invis/Iosevka#257), where they suggest to edit the font and choose a better design. However, I think rendering "raw" characters instead of a ligature when the cursor is above the glyph is a more generic and font-agnostic solution.

I'm not sure if this requires a configuration option or should become a new behavior for everyone.


UPDATE: looks like I'm not the first one who thought of this (hehe), and Qterminal and Konsole already have such behavior:

decomposition

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions