tonsky / FiraCode

Free monospaced font with programming ligatures
SIL Open Font License 1.1
76.03k stars 3.07k forks source link

Ligature priority in `->->` #1562

Open edemaine opened 6 months ago

edemaine commented 6 months ago

->-> (nested functions in CoffeeScript and Civet) seems to prefer rendering as

image

instead of what I expected, which you'd get from greedy matching:

imageimage

I don't know much about ligatures, but I'm guessing they can be assigned a weight to give them priorities. Perhaps equal priority would fix this issue? I'm not sure if there's a fix that doesn't break any use-cases, but I also can't imagine that ->-> would make sense with a >-> ligature. Alternatively, I could remove the >-> ligature for my use-case.

tonsky commented 6 months ago

Thanks! I’ll take a look

edemaine commented 5 months ago

Somewhat related: |>= is an operator in Civet (pipe assignment) that intends to render as ▷= (a triangle followed by an equals sign), but currently renders as |≥ (a vertical bar followed by greater-than-or-equals). This could be solved by priority (perhaps), or by an additional ligature. Let me know if this is better split into a separate issue; otherwise, I'll leave it here.