tonsky / FiraCode

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

Ligature request for Jinja2/Twig syntax #408

Open QuingKhaos opened 7 years ago

QuingKhaos commented 7 years ago

Hi, can we have optimized ligatures for Twig syntax? The standard symbols are:

{% some_instruction %}
{{ some_variable }}
{# this is a comment #}

and with whitespace control:

{%- some_instruction -%}
{{- some_variable -}}

dhouck commented 7 years ago

Jinja2 and I think some other template systems use this also.

QuingKhaos commented 7 years ago

Yes, twig is basically jinja2 syntax. But I don't know if Jinja2 itself has also this whitespace control :)

dhouck commented 7 years ago

It does, which is nice. I don’t know Twig so I don’t know if it works exactly the same way, but that is how you would do whitespace control.

dch commented 7 years ago

NB Prolog and Erlang and possibly other languages have generic nested data structures that include {{ for example: {{a, nested, tuple}, inside, a tuple} but {[{ a, tuple}, {that, is}, {part, of}, {a, list}]} so I'm not sure how you could manage these sorts of edge cases.

dhouck commented 7 years ago

Yeah, I was thinking of C++ now doing that too. But having tuples nested exactly two deep where the first element of the first tuple is negative is pretty rare. The {{ or }} character sequence might be incorrectly ligatured, but if it just displays with the characters closer together like .., --, >>, etc., the false positives won’t be that big a deal.

dhouck commented 7 years ago

I just realized that this is a duplicate of #244