Sublime Forum

Improve D parsing and ligature support

#1

Hi there! I found out the other day that Sublime finally got ligature support, which is great. A lot of stuff from Fira Code works beautifully, but there are still some nitpicks I have that apparently stem from the way language grammars affect ligatures.

Some stuff I’m noticing:

  • the .. operator often makes Sublime think a float literal is on the right hand side if a numeral is there
  • the => operator for lambdas doesn’t get made into the pretty Fira Code arrow
  • Stuff like 0x10 doesn’t get the smaller x character (though this is the case for every other language too, as well as +-*:)
  • /// is grouped as a double slash and one single further apart instead of the triple slash (this happens in C as well)
  • /= doesn’t get combined like in C
  • ||= doesn’t get recognized in D nor C (yet |= works just fine in both)
  • ~= doesn’t get made into the tilde with a line under it (don’t know whether it should be that way or not; this would be for concatenation)

As a side note, after an improvement update to the D grammar about two years back, class code became highlighted entirely with the “class” color. I’ve been dealing with this until now by setting that color to match regular text.

Anyways, hope to see these improvements. Thanks to the wonderful Sublime team!

0 Likes

#2

you should probably log this at https://github.com/sublimehq/Packages/issues

0 Likes

#3

These features are implemented not with ligatures, but with contextual alternates, which it doesn’t seem that Sublime supports.

0 Likes

#4

I did yesterday! Hopefully something comes of it.

0 Likes

#5

in case people want a direct link to it:

0 Likes