Sublime Forum

Dev Build 3145

#62

And I didn’t read too carefully :blush:

0 Likes

#63

They do indeed work when I change the syntax to plain text, but I want them to work when the syntax is php.

How do I go about this?

1 Like

#64

The new references are great, I noticed that symbolIndexTransformation applies to the reference index too. Could it use a separate Transformation (e.g. referenceIndexTransformation)? This would allow to index a region as a symbol with a symbolIndexTransformation as well as a reference with a different referenceIndexTransformation

0 Likes

#65

@devcarlos They are currently scoped differently:

!: embedding.php text.html.basic meta.embedded.block.php source.php meta.group.php keyword.operator.logical.php
==: embedding.php text.html.basic meta.embedded.block.php source.php meta.group.php keyword.operator.comparison.php

If the syntax is changed to capture and scope !== together, then they will be transformed into the proper ligature.

2 Likes

#66

Most likely you are running into https://github.com/sublimehq/Packages/issues/1195, or some variant.

1 Like

#67

Yep, also works in comments, but notice the colour of my comment has changed too? Is this something that is going to be fixed in the next update?

0 Likes

#68

Thanks but i’m still a little confused to how i’d go about fixing this? is there something I can do on my end or do I need to wait for an update to be pushed out?

0 Likes

#69

Should I split this out from this PR?

1 Like

#70

You can try to contribute to the Default packages (specifically PHP), but you’ll have to read up on syntax files. Or create an issue over in the Default packages, and maybe one of the contributors will take a look. Now that ligatures are available, I’m almost certain, someone with the know how will be bugged enough to fix it :slight_smile:.

Repo is here: https://github.com/sublimehq/Packages.

2 Likes

#71

Looks like @jfcherng may have beat you to creating the issue :wink:.

0 Likes

#72

I don’t think that is strictly necessary. I’m working on something else right at the moment, but I’ll work on getting fixes merged soon.

0 Likes

#73

@wbond will there be an option to use something like Fira Code as our secondary font for ligatures only and our primary font for everything else?

2 Likes

#74

I don’t have an answer for that right now.

0 Likes

#75

I know people in Atom do that with CSS to add Fira Code ligatures to other fonts like Operator Mono, or some other font that doesn’t cost 200 bucks :smirk:. Some people like Fira Code, but others only like the ligatures.

2 Likes

#76

Yeah I was playing around with that before when I stumbled across the github repo which explained it, it’s painful to come back to Sublime and see my Roboto Mono font without ligatures, specifically the arrow, it just looks so clean.

I was thinking it shouldn’t be too hard to add something like “ligature_font” or “symbol_font” I’ve never been too good at naming things :stuck_out_tongue:

1 Like

#78

Awesome job on the ligatures!

With Fira Code and build 3147 on macOS 10.13, I see ligature weirdness that doesn’t seem to depend on the formatting, like these in plain text files:

HTH,
Neb

1 Like

#79

Could you give a more specific example of how you’d use that?

1 Like

#80

Thanks for the report - Sublime Text has some internal rules to further subdivide text into tokens, beyond what the syntax definition indicates. I’ll tweak that for the next build so it doesn’t interfere with ligatures

3 Likes

#81

Despite of a certain use case, a separate referenceIndexTransformation for the list of references would be consequent. Why?

ST uses

  • symbolTransformation to transform the local SymbolList of a view
  • symbolIndexTransformation to transform the global IndexedSymbolList

Therefore using

  • referenceTransformation or
  • referenceIndexTransformation to transform the references in the global IndexedReferenceList

would extend the existing structure best.

References are defined by separate scopes which the showInIndexedReferenceList attribute is assigned to. Why not using a separate pattern for transformation as well in order to avoid cross references with the normal symbolIndex, which contains the definition but not the usage of a symbol?

Basically it is possible to manipulate a symbol/reference in nearly any way. The used transformations may be different for function definitions and function calls.

Let’s say you want to add different unicode characters as icons in front of those entries or do any other type specific stuff to the symbols’/reference’s label before printed to a quick panel. Other examples might be different indention or added keywords, …

Those transformations can be done by a plugin after requesting the window.lookup_references_in_index(...) call, but maybe there will be a built-in quick panel like Goto Reference in the future, which displays the references of a symbol under the cursor directly from the index?

0 Likes

#82

Ligatures have some funny effects in certain situations. Have a look onto the animation. It shows what happens if one selects 3 dots which are handled as ligatures. The font being used is Fira Code.

1 Like