winmerge icon indicating copy to clipboard operation
winmerge copied to clipboard

Substitution filters break with line filters

Open OshidaBCF opened this issue 1 year ago • 2 comments

I have two filters, one is a line filter "hp": \d*\.?\d* just to ignore and "hp" changes

the other is a filter to ignore an addition \n },\n "transmission": {\n "armorThrough": 50.0,\n "fireParamsPreset": "ship_engine",\n "armorClass": "armor_tank_engine",\n "armorThickness": 4.0,\n "fireProtectionHp": 10.0

image

The substitution filter is supposed to ignore the addition of the "transmission" block, but because the line just above is a "hp" change the different is actually larger

If i disable line filters this show up image

And the comma isn't in the same difference as the "transmission" block

if i change the hp value to 760, the transmission filter works image

i do not know exactly how it works, but i guess that both filters try to apply at the same time or on the same text, and it break somewhere

old.txt new.txt

OshidaBCF avatar Mar 03 '24 12:03 OshidaBCF

I haven't investigated the reason yet, but mixing Line filters and substitution filters may not work, so how about changing Line filter to Substitution filter as shown below? In addition, in the current version, it was necessary to change \n in the second Substitution filter to \r\n for attached files.

image

sdottaka avatar Mar 03 '24 13:03 sdottaka

I tried by pure luck to change line to substitution, and it worked perfectly

i didn't needed to add the \r, maybe because i have the "Cariage return difference" turned off

i should start using only substitution, because they can work on multiple lines they are much stronger than regular line filters

OshidaBCF avatar Mar 03 '24 13:03 OshidaBCF