split-diff
split-diff copied to clipboard
Resynchronize Lines
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.
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.
Could potentially be fixed by #114