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

Ligature for "===>" buggy #151

Closed
Midar opened this issue Feb 15, 2020 · 15 comments
Closed

Ligature for "===>" buggy #151

Midar opened this issue Feb 15, 2020 · 15 comments
Labels
enhancement New feature or request

Comments

@Midar
Copy link

Midar commented Feb 15, 2020

Right now, ===> gets rendered as === ligature and > - which looks really strange. Could either the === ligature be disabled if followed by an >, or a ligature for ===> be added?

@qgates
Copy link

qgates commented Feb 15, 2020

This doesn't appear as a ligature in Fira or Hasklig either. What language is this symbol used in?

@Midar
Copy link
Author

Midar commented Feb 15, 2020

It's a common sequence in terminal apps. I don't think there needs to be a ligature for ===>, but it would make sense to disable the === ligature when it's followed by a >

@philippnurullin
Copy link
Member

@Midar Can you send the screenshots with its usage, & explain more context. When it's used & for what propose.

@qgates
Copy link

qgates commented Feb 17, 2020

Don't want to speak for @Midar but when using ===> it looks strange when the === part is converted into its ligature. Midar's suggestion of disabling the ligature when followed by > would definitely be better, alternatively a longer version of ==> ligature might work too.

FWIW in case you missed above, Fira Code and Hasklig seem to have the same issue.

@auduchinok
Copy link
Contributor

auduchinok commented Feb 17, 2020

Sometimes this sequence is used as a progress indication, adding more = as it's progressing.
Here're some examples found online:

https://www.mathworks.com/matlabcentral/mlc-downloads/downloads/submissions/30297/versions/2/screenshot.PNG

https://www.tecmint.com/wp-content/uploads/2015/10/pv-command-examples.png

Here's another progress lib example, though it uses - instead of =:
https://github.com/eichf/progress_bar

@qgates
Copy link

qgates commented Feb 17, 2020

Yes, and since ===> isn't a meaningful symbol in itself I would probably lean towards disabling the ligature in cases where its prepended with < or appended with >. I don't think there are any edge-cases where this wouldn't work.

The alternative is to change the === ligature to be a longer version of the == ligature, which would fit these use-cases better than the current three line version. But that's more work, and I'm not sure everyone would agree 😉

@andrebrait
Copy link

Personally, I wouldn't like === to be just a longer ==. The length along wouldn't make for a good way to distinguish the two when reading code.

@Midar
Copy link
Author

Midar commented Feb 17, 2020

@qgates No, that's exactly what I meant :).

Here's a screenshot of how it looks (first line) and how it should look (second line):
Bildschirmfoto 2020-02-17 um 22 58 34

Alternatively, of course, there could be a ligature like for ==> - I guess ===> is not that uncommon, and it would look nicer if an app uses several levels, e.g.:

===> Main action that is being done
==> Task of that action
=> Some subtask

Which, of course, would look inconsistent without a ligature for ===>. But then the question is where to draw the line. ====> maybe? I don't think I've ever seen more than that in these cases.

Of course, the least effort and completely sufficient is to just disable the ligature for === if it's followed by anything other than space, alphanumeric or $, as then it's very very unlikely to be used for a comparison.

@thewilkybarkid
Copy link

Just seen a progress bar in a log file showing ligatures sometimes being used:

Screenshot 2020-02-18 at 15 00 36

@qgates
Copy link

qgates commented Feb 18, 2020

As ligatures are meant to provide meaningful symbol replacements, if possible they should probably be disabled in these edge-cases since there is no meaningful ===> symbol, ie. === with < or > at either end.

Speaking more generally, I'd be curious to know how other ligature fonts like Fira Code or Haskell deal with situations like @thewilkybarkid posts above: I suspect it will be much the same. When ligature fonts are used in a text editor, for given file/syntaxes many modern editors allow ligatures to be enabled or disabled either entirely or for given lexer scopes. This could be a viable workaround for (eg) viewing logs in an editor.

Just an opinion, but JBM is designed primarily as a coding font where ligatures are most useful. Perhaps in time a version of the font without ligatures will be available that would better suit general terminal / console use.

@philippnurullin
Copy link
Member

I think disabling the ===> sequence is a good move. I agree with @qgates that this symbol doesn't have any logic behind it so it will only create noise.

The problem in loading sequence like [==> can be treated by adding the exclusion if it have [ in it.

@Midar

===> Main action that is being done
==> Task of that action
=> Some subtask

Is this a common practice? Seeing it for the first time. What language is this?

Fira Code
Screenshot 2020-02-19 at 12 05 19

Hasklig
Screenshot 2020-02-19 at 12 05 35

@philippnurullin philippnurullin added the enhancement New feature or request label Feb 19, 2020
@Midar
Copy link
Author

Midar commented Feb 19, 2020

It's quite common for any type of grouped output, or progress output indeed. A similar problem exists with ***, where for two * it's normal as it is for four, but for 3 one is a little higher.

I think it's not worth adding a ligature for ===>, but to just disable the === ligature if anything other than [0-9a-zA-Z\s$] is followed, because I don't think having the === ligature followed by an > is something that would ever be wanted.

philippnurullin added a commit that referenced this issue Mar 11, 2020
— Added No Ligature version. Only in `.ttf` format. It called **JetBrains Mono NL**. #19
— Fixed problems with tiny gaps between the Box Drawing elements. #84
— Balanced the size of `<>` `</>` ligatures to match in mass. #116
— Fixed problem with not working `<--` ligature. #95
— Added `U+FEFF` symbol. No-break zero space. #147
— `<!--` `-->` ligatures now should be on the same heights. #77
— Corrected `===>` behaviour in loading sequences. #151
— Corrected `A` placement in italics.
— Made dot in the `0` smaller, so it will be more distinguishable from `8` at small sizes.
philippnurullin added a commit that referenced this issue Mar 26, 2020
— Lowered the height of Powerline arrows #172
— <*> Interpolation bug fix #180
— Removed ligatures from loading sequences [-> [=> #151
— Tuned 1 to be more distinguishable from i in small sizes #176
— Sorted glyphs by unicode order #170
— Added U+02BC "Modifier Letter Apostrophe" #168
— Added new ligature @_
— Added 29 glyphs: ƏəǦǧǪǫǴǵ∀∃∈∋∐⟨⟩∧∨∷∼≈≡⍴­■▲▶▼◀◆●
— Added support of https://unicodepowersymbol.com/
— Refactored ¶ l j
@philippnurullin
Copy link
Member

This changes won't affect the === ligature. Only the ===> [=> [-> sequences is treated.

@trygveaa
Copy link

Seems like the -- and --- ligatures are still used in [--> and [--->. I guess those should be excluded as well?

shot_2020-03-30_11-34-46_247x349

@philippnurullin
Copy link
Member

Yes, they are. Will remove them in the next update. Thanks!

philippnurullin added a commit that referenced this issue Apr 8, 2020
— Fixed problem with disappeared Powerline arrows #189
— Added U+0336 #190
— Added >-> Ligature #194
— Fixed rendering problems with arrow in ligatures #196
— Added exclusion in ligatures with -- --- to treat loading #151
— Added source files in .ufo format
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

7 participants