This cannot be fixed, because nano uses regexes for coloring things,
and always applies all coloring rules to any line -- there is no
mechanism to make a rule stop the processing of further rules.

So, '//' cannot prevent the recognition of '/*' on the same line.

You yourself can edit the c.nanorc file and make this change:

-color brightblue start="/\*" end="\*/"
+color brightblue start="(^|\s)/\*" end="\*/"

This will recognize '/*' only when it is at the start of a line OR
preceded by whitespace.  This prevents misinterpreting '//*' as a
start of multiline comment.  But this does not colorize an inline
comment/*like this*/correctly, and I value this more than the '//*'
case.  So... won't fix.


By the way, your example is not well aligned:

> //***********************
// A nice extended comment
//***********************

It should probably look like this:

//*************************
// A nice extended comment
//*************************


Benno

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to