No announcement yet.

Commented-out code differences in C#

  • Filter
  • Time
  • Show
Clear All
new posts

  • Commented-out code differences in C#

    When comparing two C# files in which one file has some lines of code commented out, the display shows the whole lines as different (at least with my current settings). In some cases, it would be easier to analyze the files if a line of commented-out code showed only the commenting characters, such as "//", and any other actual differences, as different, instead of the whole lines. Is there a setting to do that? Thanks.


  • #2
    Beyond Compare only marks text as a match if they have the same grammar element type as defined in Tools > File Formats. If one side is a commented out version of the same text on the left, the entire thing will show as a difference because the grammar element types are different.

    To make the commented text show as a match and only the commenting characters show as a difference, delete the definition of comment from the file format. Open Tools > File Formats. Select the format that matches your files. Go to the Grammar tab. Select Comment, click - to delete it, then Save.
    Chris K Scooter Software


    • #3
      That worked. Thanks. You guys do great support.