Firacode: {...} looks weird

Created on 3 Apr 2017  Â·  14Comments  Â·  Source: tonsky/FiraCode

When using object spread with React it looks odd:

screen shot 2017-04-02 at 5 33 15 pm

Most helpful comment

Spread operator should be connected to the object/var its spreading. Right now it looks like this:

FiraCode spread operator unattached

However this is javascript specific. I am not sure if any other languages make use of spread like this. It might be used as an ellipsis... However, what use would there be for an ellipsis if this is not meant for text? Anyway, I digress. It more obviously gives its purpose like this:

FiraCode spread operator attached

All 14 comments

I can’t reproduce this issue:

{...props} {...}

{...props} {...}

See https://github.com/tonsky/FiraCode#changelog. 1.202 and 1.203 doesn’t have it, 1.204 has it again. I should prob. remove it again :)

Would it be possible to just give ... (and probably .., for good measure) priority over {. and .}? I can still think of cases where the ligature would look weird in shell even with those changes, but a lot of ligatures look weird in shell.

Thanks @dhouck it’s a good idea!

Spread operator should be connected to the object/var its spreading. Right now it looks like this:

FiraCode spread operator unattached

However this is javascript specific. I am not sure if any other languages make use of spread like this. It might be used as an ellipsis... However, what use would there be for an ellipsis if this is not meant for text? Anyway, I digress. It more obviously gives its purpose like this:

FiraCode spread operator attached

@Redmega The problem is that Fira Code can’t tell if the text next to it is a letter, because it’s in a different HTML element.

because it’s in a different HTML element.

Can you explain what you mean by that? I'm not following.

For the record, [...[1,2,3]] is valid as well, so it wouldn't only be letters.

Most ligatures don’t work between two highlighting colors. It looks like you are using Atom, so if you right-click on the ... and choose “Inspect Element,” you’ll see they’re in different elements.

Ahh ok. I understand now. So normally they would be connected but it's my theme that's causing it to become disconnected? I'll look into changing it.

Support for putting it next to the letter isn’t implemented at the moment either, but if they’re different elements it won’t work even if it’s implemented.

Changing the theme won’t help; they will still be different elements even if they happen to display the same.

EDIT: With other editors, like vim in terminal, ligatures can cross syntactic tokens as long as they display the same. It’s in various underlying details of the parser and editor that probably change for every implementation.

I actually like the ... being separated doesn't matter to me whether it's a spread or not. Makes it easier to read in any case! Keep it as is! Yay for Fira Code!

I do agree that it should stay in the middle instead of right aligned. There's other languages that use the ellipsis besides the JS spread.

Thanks @jupl, interesting to know! I knew the ruby one but it slipped my mind.

Should be fixed in 1.206, see #635

Was this page helpful?
0 / 5 - 0 ratings

Related issues

miniBill picture miniBill  Â·  4Comments

iyzana picture iyzana  Â·  3Comments

pamu picture pamu  Â·  3Comments

magnus-madsen picture magnus-madsen  Â·  3Comments

RustemB picture RustemB  Â·  4Comments