bugGNU nano - Bugs: bug #62497, highlight of line comment in C...

 
 

You are not allowed to post comments on this tracker with your current authentication level.

bug #62497: highlight of line comment in C goes wrong when followed by a star

Submitter:  Timothy Liu <timothyliuxf>
Submitted:  Sat 21 May 2022 06:19:57 PM UTC
   
 
Severity:  3 - Normal Status:  Cantfix
Assigned to:  None Open/Closed:  Closed

Sat 14 Sep 2024 10:19:45 AM UTC, comment #4: 

This is a special-case duplicate of bug #49945.

Benno Schulenberg <bens>
Group administrator
Mon 01 Aug 2022 01:36:40 PM UTC, comment #3: 

As there is no response, closing.

Benno Schulenberg <bens>
Group administrator
Sun 22 May 2022 09:29:38 AM UTC, comment #2: 

It could be solved by making this change in syntax/c.nanorc:

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

However, this will colorize any character directly before the '/*'.  Usually this will not be a problem, but it will look wrong and ugly when you comment out something in the middle of a line and don't precede the commented-out piece with a space or tab.  Which of the two miscolorings is more annoying?

(The problem has become more common in 6.3 because it now also colorizes unterminated start-end regexes, as the NEWS mentioned.)

Benno Schulenberg <bens>
Group administrator
Sun 22 May 2022 01:33:51 AM UTC, comment #1: 

This problem is rarely in nano-4.8 (but for some specific files, this problem exists, but the code is too long to upload).
But in nano-6.3, this problem is common.

Timothy Liu <timothyliuxf>
Sat 21 May 2022 06:19:57 PM UTC, original submission:  

When I use line comment followed by a '*' character, that is '//*' , the nano editor will recognize '/*' as the beginning of a block comment, making the following codes all hilighted as comment.
For example:

//* blablabla
int main(void) {}

Timothy Liu <timothyliuxf>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by bens (Posted a comment)
  • -email is unavailable- added by timothyliuxf (Submitted the item)
  •  

    There are 0 votes so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-09-14 bens StatusNone Cantfix
    2022-08-01 bens Open/ClosedOpen Closed
    2022-05-30 bens SummaryHighlight of line comment of C and C++ goes wrong when followed by a star character, like: //* highlight of line comment in C goes wrong when followed by a star

    Back to the top

    Powered by Savane 3.15-e6e5.
    Corresponding source code