tonsky / FiraCode

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

Add ---> ligature #237

Closed nesteruk closed 7 years ago

nesteruk commented 7 years ago

You can get the ---> as a combination of -- and ->; would be nice if there was a ligature for it and if it was somehow different from the -> ligature.

tonsky commented 7 years ago

Can you provide an example of how this could've happen?

nesteruk commented 7 years ago

Let's say you have a class Foo implementing operator-- that returns a Bar& and then you have a Bar that has operator ->. Thus, you can write foo--->whatever();.

JonathonReinhart commented 7 years ago

@nesteruk Those are two different operations, and I don't think it makes any sense to combine them. After all, the whole point of ligatures is to convert two-character sequences that have a single meaning to a single token that our brain has to process. If foo--->whatever() was converted to one long arrow, your brain would have to actively *disassemble" it into the -- and -> operators, which is counter-productive to the goal of ligatures.

krux02 commented 7 years ago

Sorry for my two cents, but I honestly think this is really a silly idea to want it for c++. I mean I could understand if you want it for another programming language that has the ---> token, but not for c++.

tonsky commented 7 years ago

Yeah, if that’s two different operations we don’t want to have them as a single ligature. It’ll be against the font goals