split-diff icon indicating copy to clipboard operation
split-diff copied to clipboard

Resynchronize Lines

Open davidrohr opened this issue 9 years ago • 2 comments

Feature Request: There is a windows tool called Total Commander that has a very nice file-diff tool. One of its very convenient features is to tell the diff to resynchronize the lines at certain line numbers in both files. This is usefull if you have a large difference at the beginning of the files, such that the lines in the diff get out of sync, and then the entire remainder of the files looks different even though the files are identical below the one large difference. Resynchronizing the lines essentially restarts the diff of both files at the lines indicated.

davidrohr avatar Nov 14 '16 10:11 davidrohr

I can't seem to find a closer issue than this one to report the behavior I've been seeing, so I thought I'd second the need for this feature and add comments on my own experience with split-diff.

First, THANKS for this feature. I use it constantly. It's very close to perfect, but here's where it's not:

It often gets out of sync when comparing files (for me these days bash scripts and AWS CloudFormation Templates in JSON) unless the changes are very simple, 1 or 2 lines with large blocks of identical text above and below. It would be best if it could better detect and align matching text with some algorithm that focuses on the visible portion of the file, instead of having to re-sync the two panes manually as this enhancement suggests, as I can see that being a pain to have to do frequently. Something like calculating a per-line hash and attempting to match the largest blocks of consecutive line hashes near the current viewport into the file.

I'm sure you're working on improving this, just thought I'd add my voice to the chorus that better synchronization is the main pain point on an otherwise excellent feature.

michael-crawford avatar May 23 '17 17:05 michael-crawford

Could potentially be fixed by #114

mupchrch avatar Aug 16 '17 20:08 mupchrch