Results 1 to 2 of 2
  1. #1
    Join Date
    Nov 2015
    Posts
    1

    Default How to ignore identical lines commented out in one file but not the other?

    I commented out multiple lines of C code in one file using /* ... */ and have them uncommented in my other file.

    I would like to be able to see that the only differences are the lines with added "/*" and "*/". If I make all grammar items UNIMPORTANT then I can almost do this, except the /* and */ lines are not considered important. Enabling just "Comments" marks the entire block as different.

    If I disable the C/C++ file format support then it basically does what I want. Is that my only option? I guess what I want is to have the C/C++ grammar coloring while having the files compared as if they were plain text files.

    Thanks.

  2. #2
    Join Date
    Oct 2007
    Location
    Madison, WI
    Posts
    4,584

    Default

    To change the comment behavior, open Tools > File Formats.
    Select the C/C++ file format.
    Go to the Grammar page.
    Select Comment=Text from /* to */.
    Click the gear button to edit the element.
    Change the element name from Comment to CommentBlock.
    Click OK, then save the file format.

    When you compare files in the Text Compare, click the Rules toolbar button. Now you can check CommentBlock to make it important but leave Comment unchecked to treat single line // comments as unimportant.

    As an alternative, you can also delete the /* to */ grammar element to make comment blocks be treated as default text.
    Chris K Scooter Software

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •