Sublime Text syntax highlighting
Devin Nusbaum <d.w.nusbaum@...>
I've created a simple syntax definition for Stanza for Sublime Text, available at https://github.com/dwnusbaum/stanza-syntax. It has plenty of rough edges, but it's been working well for me so far. Note: Although the installation instructions mention package control, I'm still waiting for it to be added to the official package control repository, so you'll have to install it manually. Thanks, Devin
|
|
That's great. We have a couple of guys here at Berkeley using Sublime and they've been lamenting the lack of a Sublime definition. Thanks! -Patrick
|
|
Great to see more editor support! Sublime Text follows the same tradition as Atom in using the TextMate language definition format. Sublime even directly supports Jake
|
|
Devin Nusbaum <d.w.nusbaum@...>
Nice! I didn’t realize Atom also used the TextMate language definition format. it’s interesting to see what we each chose to highlight. Have you come up with a good way to highlight LoStanza constructs without also highlighting them in regular Stanza? I find it difficult to do well with the .tmlanguage format. Sublime Text 3 has a new context based .sublime-syntax format that is more powerful, which I think will make it possible to highlight LoStanza really nicely.
On Jun 26, 2016, at 9:54 AM, Jake Russo <madcap.russo@...> wrote:
|
|
Hehe, that was incredibly challenging and ended up proving unfruitful. I tried numerous things and arrived at a variety of broken implementations. Here is my last commented-out attempt. I decided that users would just have to be diligent in their coding. It's my least favorite thing to do as I feel this is the area where syntax-highlighting is most useful but I couldn't find a good-enough solution. Please due share if you come up with something and I'm interested to hear how you do with the new ST3 format. In fact, this is why I am also working on Howl support because I very nearly have a working solution that even provides special background highlighting to indicate that you are in a lostanza block. They out-of-the-box have a
|
|
Actually, after some reading of other Atom language packages, I found one that had the regex I needed: language-haml.
This little regex as an end pattern properly captures empty lines and de-indentation (of course, you need to capture the initial indentation for
|
|