Compare by content: missed difference when merging 2 files

The behaviour described in the bug report is either by design, or would be far too complex/time-consuming to be changed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
mag
Junior Member
Junior Member
Posts: 35
Joined: 2008-10-06, 08:35 UTC

Compare by content: missed difference when merging 2 files

Post by *mag »

2 files to compare:
1.txt

Code: Select all

a
b
c
d
e
f
g
h
i
j
k
l
m
n
o
2.txt

Code: Select all

a
b
f
i
j
k
o
Use Compare by content on them, enable edit mode and try to merge all differences from 2.txt to 1.txt:

1. click on Next difference - takes 1st block of differences (lines c,d,e)
2. merge these differences from 2.txt to 1.txt (Copy <-) - lines c,d,e are removed from 1.txt - OK
3. click on Next difference - skips the 2nd block of differences (lines g,h) and goes to the 3rd one (lines l,m,n) - not OK

I have to go back then (Previous difference) in order to get to merging the 2nd block.

It seems the cause is that there's only 1 line between the 1st and 2nd blocks of differences. If there are more than just 1 line then it's fine.

TC 9.0a x64
User avatar
Horst.Epp
Power Member
Power Member
Posts: 6450
Joined: 2003-02-06, 17:36 UTC
Location: Germany

Post by *Horst.Epp »

No such problem here !
I press 3x Next difference followed by Copy ->
Then both sides (Files) have the same content
Windows 11 Home x64 Version 23H2 (OS Build 22631.3374)
TC 11.03 x64 / x86
Everything 1.5.0.1371a (x64), Everything Toolbar 1.3.2, Listary Pro 6.3.0.69
QAP 11.6.3.2 x64
mag
Junior Member
Junior Member
Posts: 35
Joined: 2008-10-06, 08:35 UTC

Post by *mag »

Well, then I have no clue why it happens to me, but really it skips the 2nd block here.

EDIT: I played with the settings in the compare by content (Ignore repeated spaces, Ignore frequent lines) and after unselecting them all and reselecting them again (e.g. ending up with exactly the same setup as before) it strangely started to work properly. No idea why.
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Post by *gdpr deleted 6 »

I can reproduce mag's problem exactly as he described.
But contrary to mag, I can't make it work properly not matter how much i play around with the settings...
gdpr deleted 6
Power Member
Power Member
Posts: 872
Joined: 2013-09-04, 14:07 UTC

Post by *gdpr deleted 6 »

Horst.Epp wrote:No such problem here !
I press 3x Next difference followed by Copy ->
Then both sides (Files) have the same content
Not "Copy ->". Try "Copy <-" as per OP!
mag
Junior Member
Junior Member
Posts: 35
Joined: 2008-10-06, 08:35 UTC

Post by *mag »

I relaunched TC (after restarting the whole OS) and the issue is back again and this time I'm unable to avoid it any way (no idea what exactly helped before).

And yes, you need to perform "Copy <-" with 1.txt on the left and 2.txt on the right - e.g. you are removing lines from 1.txt to make it match 2.txt.
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48021
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

TC remembers the last position of the "Next difference". When you remove text from a file in any way, this will not be updated. So when you click "Next difference" again, it will start searching from that un-updated last position. Unfortunately there are too many ways to modify a file, so I can't keep track of that last position. The user may even remove the part with the last match. Just use "Previous difference" if that happens.
Author of Total Commander
https://www.ghisler.com
Post Reply