WinMerge / winmerge

WinMerge is an Open Source differencing and merging tool for Windows. WinMerge can compare both folders and files, presenting differences in a visual text format that is easy to understand and handle.
https://winmerge.org/
GNU General Public License v2.0
6.43k stars 798 forks source link

Incorrect work of substitution filters #2335

Open ivti81 opened 4 months ago

ivti81 commented 4 months ago

I'm trying to compare 2 XML files with ignoring XML comments. To do this I've created substitution filter by using regular expressions:

^<!--[\s\S]*-->$

If XML comments are in both files it works OK, but when XML comment absent in of the file, WinMerge consider them as unequal. Files to compare and screenshot are attached. winmergebug.zip Screenshot

WinMerge version: 2.16.40.0 X 64 Config file: WinMerge.txt

sdottaka commented 4 months ago

Unfortunately, the current WinMerge has a weakness in processing files that do not have a newline character at the end of the file, like the one you attached. If there is a newline character at the end of the file on the right and the "Ignore blank lines" option is enabled as shown in the image below, you will get the expected result.

image

ivti81 commented 4 months ago

Thank for prompt reply. Will this weakness be fixed it future releases?

sdottaka commented 4 months ago

If it were to be fixed, it would be a relatively large fix and would not be released immediately.