FiraCode icon indicating copy to clipboard operation
FiraCode copied to clipboard

Add option to {de}activate the ?.

Open GrayJack opened this issue 2 years ago • 6 comments

In Rust it's pretty common to have a question mark followed by a dot and the ligature:

  • makes the ligature unaligned with the rest of the code
  • makes the highlight fail on some editors

Fira Code (Ligatures) image

Fira Mono (No ligatures) image

GrayJack avatar Feb 01 '22 06:02 GrayJack

I am not sure what are you saying. ?. shouldn’t be grouped?

tonsky avatar Feb 01 '22 14:02 tonsky

Yes, @tonsky that is correct

GrayJack avatar Feb 01 '22 17:02 GrayJack

For non-rustaceans: this is something like combining the ). in foo().bar

jearmstrong21 avatar Feb 02 '22 04:02 jearmstrong21

Oh I see. I only saw it in Kotlin, and in Kotlin it’s a single operator, not ? and . combined. Makes sense to make a stylistic set then, thanks!

tonsky avatar Feb 03 '22 18:02 tonsky

It would be better to be enabled by default.

?. is the optional chaining operator in JavaScript and it is popular among JavaScript developers.

mon-jai avatar Feb 22 '22 09:02 mon-jai

For me personally, doesn't make a difference what is the default, as long as it is possible to toggle it. So as long most people are happy with the default, it works for me

GrayJack avatar Mar 06 '22 23:03 GrayJack