Sublime Forum

Highlighting && operator

#1

High, im trying to get the " && " operator to highlight. For example
If (var = 1 && var2 = 2)

I have been attempting to modify the operator section within the Autohotkey.tmLanguage file

<dict> <key>name</key> <string>keyword.operator.ahk</string> <key>match</key> <string>=|==|&lt;&gt;|:=|&lt;|&gt;|\*|\/|\+|:|\?|\-|!=|.=||\|\|</string> </dict>

I was able to get the " || " (or) operator to highlight, but it seems I can’t find the magic combination for the && operator?
I’ve tried &&, &{2} and a couple of others.

Many thanks in advance.

Cheers.

0 Likes

#2

Try <string>=|==|&lt;&gt;|:=|&lt;|&gt;|\*|\/|\+|:|\?|\-|!=|.=||\|\||&amp;&amp;</string> as used in JavaScript.tmLanguage.

0 Likes

#3

Thanks mate, that worked a treat.

0 Likes