highlighting negative numbers?

Syntax highlighting, code folding, brace matching, code indenting, and function list

highlighting negative numbers?

Postby JohnJSal » Thu Oct 26, 2006 2:45 pm

Is it possible to highlight numbers preceded by a negative sign? I have numbers set to be blue, but when they are negative UE doesn't detect them.

Thanks.
User avatar
JohnJSal
Advanced User
Advanced User
 
Posts: 60
Joined: Sat Mar 05, 2005 12:00 am

Re: highlighting negative numbers?

Postby Mofi » Fri Oct 27, 2006 2:22 pm

There are 2 solutions for it depending on the syntax/content of your file.

  1. Specify the character - as delimiter at /Delimiters = and specify - in a color group /Cx"..." which also uses the blue color like the numbers.

  2. Create a color group for negative numbers and use also the blue color for this color group. The negative numbers are defined with the substring definition. Example:

    /C8"Negative Numbers"
    ** -0 -1 -2 -3 -4 -5 -6 -7 -8 -9
Solution 2 has the advantage that words with a - in the middle like text-align are still recognized as one "word". But with solution 2 a delimiter character must exist before every negative number.
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4056
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: highlighting negative numbers?

Postby JohnJSal » Fri Oct 27, 2006 2:51 pm

Thanks!
User avatar
JohnJSal
Advanced User
Advanced User
 
Posts: 60
Joined: Sat Mar 05, 2005 12:00 am


Return to Syntax Highlighting