Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#1155 Line filters active if one side matches

open
nobody
None
5
2012-12-21
2010-08-18
FriendFX
No

Hi,

I use WinMerge to compare files which contain lines like the following:
SSR_SHIFT 16 04A7
SSR_RESP 16 F029
SSR_SHIFT 16 1008
SSR_RESP 16 XXXX

Now lines with the Xes usually only happen in one file (I use the left diff pane for these), while the other one (right pane for me) usually never include Xes.

If a line on one side (my left one) includes the Xes, I would like WinMerge to filter the line (on both sides), means to ignore any differences.

I have found a tracker entry "Option to ignore line numbers in code - ID: 1283091" which seems to have the (pre-diff or filter) functionality I could use for my application, but for some reason I couldn't find the RCLocalizationPluginU plugin in the MergePlugins directory - has it been removed? I kinda liked the idea of having a INI file control what the plugin does, that way I could tailor it to many different applications.

But for my problem at hand, a simple checkbox for a line filter entry saying "filter line if one side matches" would do the trick.

Discussion

  • FriendFX
    FriendFX
    2010-08-18

    Having thought about it a little more, it would also need to specify which side to match. Because while the following comparison should be filtered (not highlighted as different)
    | SSR_RESP 16 XXXX | SSR_RESP 16 123B |
    lines like
    | SSR_RESP 16 123B | SSR_RESP 16 XXXX |
    should be shown as different.

     
  • FriendFX
    FriendFX
    2010-08-19

    You can ignore the last comment if that causes problems, as I realised that I can generate the left-hand side file using different values than Xes, such as Ys. Therefore, if a line matches the regular expression "^SSR_RESP\s+[0-9]+\s+[Y]+", it would detect that it can be ignored - regardless in which pane the file is open.