WinMerge add some blank lines when compare two files with line filters #988
-
Hello everyone. I have used WinMerge to compare two folders and today I found a very strange problem. So I compare those two files with WinMerge, apply this line filter: .*\/\/.*Token:.*RID.* This line filter will ignore all differences like this: But at the end of the file, WinMerge show this difference which I cannot understand: I have opened two files in VSCode, notepad and haven't seen this blank line. I have also checked the number of lines in two files with command |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
What you are calling a blank line is a line with a gray background? A line with a gray background is not a real line, but a virtual line that indicates that the corresponding line on one side is missing or has been deleted. The lines on the right with a gray background is displayed because the Diff algorithm adjusted the left 2207 line and the right 2205 line to be displayed in the same position, since the contents of the left 2207 line "// Token: 0x04005FD RID: 1533" and the right 2205 line are the same. Unfortunately, WinMerge's Line Filters are applied after the Diff algorithm has adjusted the display position, so you did not get the expected results. There are plugins called Prediffer plugin that is applied before the comparison. These plugins process the contents of the files before comparison, but the original contents are displayed when they are viewed. Among the Prediffer plugins, there is a plugin called IgnoreCommentsC (Ignore Comments (C-Familly Languages)). It removes the contents of C++ and C# comment lines before comparing them, and if you apply it, you will get the expected result as shown below. If you want this plugin to be applied automatically when comparing files, select "Plugin" -> "Automatic Prediffer". |
Beta Was this translation helpful? Give feedback.
What you are calling a blank line is a line with a gray background? A line with a gray background is not a real line, but a virtual line that indicates that the corresponding line on one side is missing or has been deleted.
The lines on the right with a gray background is displayed because the Diff algorithm adjusted the left 2207 line and the right 2205 line to be displayed in the same position, since the contents of the left 2207 line "// Token: 0x04005FD RID: 1533" and the right 2205 line are the same.
Unfortunately, WinMerge's Line Filters are applied after the Diff algorithm has adjusted the display positi…