Highlighting comments (whole line)

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

Highlighting comments (whole line)

Postby Bego » Wed Nov 24, 2004 5:52 am

Hi all

Is it possible to REALLY define a (one line) comment-highlighting (comment sign is #) ?

example 1: highlighted ok
#this comment is fully highlighted ok

example 2: highlights from # on to the right :-(((
if $(#) > 0 then ......

I saw a workaround of using "** # " (without quotes) in te methods section, but this does not highlight things like this:
# this comment is not highlighted because of space after comment

The rule is: if comment sign is first sign, highlight all.
I can live with things like this:
if a < b then #this comment might not be highlighted

Any solutions ?

Thanks, Alex
User avatar
Bego
Master
Master
 
Posts: 357
Joined: Wed Nov 24, 2004 12:00 am
Location: Germany

Re: Highlighting comments (whole line)

Postby Mofi » Wed Nov 24, 2004 10:40 am

There are several options to specify the line comment more specific - see help of UltraEdit about Syntax highlighting.

Solution 1:
Adding Line Comment Valid Columns = [1] to the language definition line will help you (your rule is fullfilled).

Solution 2:
Adding Line Comment Preceding Chars = [~0-9a-z()] to the language definition line will highlight all your examples correct.

But the best thing for languages, where a single line comment is also a valid operator, is to extend the single line comment character by yourself to a string. For examples write always #-> when you write a line comment and highlighting is much easier (and also finding comments).
User avatar
Mofi
Grand Master
Grand Master
 
Posts: 4041
Joined: Thu Jul 29, 2004 11:00 pm
Location: Vienna

Re: Highlighting comments (whole line)

Postby Bego » Thu Nov 25, 2004 2:43 am

Hi Mofi,

you got it ! Thanks a lot.

Alex (p.s. greets from germany :-)
User avatar
Bego
Master
Master
 
Posts: 357
Joined: Wed Nov 24, 2004 12:00 am
Location: Germany


Return to Syntax Highlighting