Author Topic: C style comments color coded incorrectly.  (Read 3028 times)

Robert Hall

  • Community Member
  • Posts: 33
  • Hero Points: 3
C style comments color coded incorrectly.
« on: September 26, 2017, 08:33:31 PM »
Top line of multi comment C files are color coded differently than the rest.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2896
  • Hero Points: 153
Re: C style comments color coded incorrectly.
« Reply #1 on: September 26, 2017, 08:37:08 PM »
It looks like this might be the current line color.  Does it change if you move the cursor?

Robert Hall

  • Community Member
  • Posts: 33
  • Hero Points: 3
Re: C style comments color coded incorrectly.
« Reply #2 on: September 26, 2017, 08:39:57 PM »
No.

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2896
  • Hero Points: 153
Re: C style comments color coded incorrectly.
« Reply #3 on: September 26, 2017, 08:48:04 PM »
Ah, I see the issues.  The ones with multiple starts like that are being picked up as "Documentation Comments".  If you go to Document>C/C++ Options (with a C++ file open) and pick "Color Coding" and then click on "Colors..." on the top right, under the section "Comments", you'll see that "Block Comment" and "Documentation Comment" have different colors.  You can just set these the same.

Robert Hall

  • Community Member
  • Posts: 33
  • Hero Points: 3
Re: C style comments color coded incorrectly.
« Reply #4 on: September 26, 2017, 08:49:23 PM »
As a workaround, or is this the correct behavior?

Dan

  • SlickEdit Team Member
  • Senior Community Member
  • *
  • Posts: 2896
  • Hero Points: 153
Re: C style comments color coded incorrectly.
« Reply #5 on: September 26, 2017, 08:52:14 PM »
This is the correct behavior.  A lot of people like this type of comment:

Code: [Select]
/**
 *
 * @author dan (9/26/2017)
 *
 * @param argc
 * @param argv
 */

and this type of comment:

Code: [Select]
int x; /*this is a variable*/
to be color coded differently.

Robert Hall

  • Community Member
  • Posts: 33
  • Hero Points: 3
Re: C style comments color coded incorrectly.
« Reply #6 on: September 26, 2017, 08:55:22 PM »
I've coded this way since 1983.

So I'll use the workaround and make them the same color.

jporkkahtc

  • Senior Community Member
  • Posts: 2620
  • Hero Points: 210
  • Text
Re: C style comments color coded incorrectly.
« Reply #7 on: September 26, 2017, 11:07:52 PM »
Try this: Open Tools > Options > Appearance > Colors

Now left-click on the text in your C source.
Options will change the selected color.

In your case, when you click the text that is a comment but not comment colored, "Documentation Comment" gets selected.

Very handy V22 feature!