Sublime Forum

Javascript Highlight (Fail?)

#1

First, Sublime Text 2 is awesome. Thanks x 1000.

Just a couple questions / issues with Javascript highlighting that I wanted to see if they should be working, have plans to get them to work, or somebody could direct me to where I could maybe add functionality myself:

  1. “this” is not highlighted - seems like “this” should be in there already, so maybe this is a bug
  2. function params are highlighted in declaration, but highlighting doesn’t persist within function scope:
function (a <-- orange) {
   ++a; <-- not orange
}
  1. The same goes for function names (default, neon green) not persisting.
  2. Likewise for "var"s.

Again, I might be able to add support for these myself, if they’re currently not implemented, but intend to be, but I just wanted to make sure I wasn’t missing something obvious / there’s not already a Javascript Syntax Highlighter Package that has implemented these.

Cheers,
Adam Crabtree

0 Likes

#2

The syntax highlighting doesn’t track variables and their highlights, it just uses regex to highlight things under certain rules. So, in javascript, the function declaration variables are targeted as orange, and normal variables are not.

0 Likes