GNOME Bugzilla – Bug 505087
Differences and UP and DOWN buttons
Last modified: 2009-06-27 08:08:01 UTC
Please describe the problem: When I compare the two files below (and many others), meld up and down buttons doesn't go to all differences. http://firebird.cvs.sourceforge.net/firebird/firebird2/builds/win32/msvc8/engine_embed.vcproj?revision=1.10.2.3&view=markup&pathrev=B3_0_Transition http://firebird.cvs.sourceforge.net/firebird/firebird2/builds/win32/msvc8/engine_embed.vcproj?revision=1.10.2.4&view=markup&pathrev=B3_0_Transition And the diff: http://firebird.cvs.sourceforge.net/firebird/firebird2/builds/win32/msvc8/engine_embed.vcproj?r1=1.10.2.3&r2=1.10.2.4&pathrev=B3_0_Transition When I enter in the compare window, the first difference is showed, and it go to the last one when I press the down button. I'm using V 1.1.5.1 in Ubuntu Gutsy. Steps to reproduce: Actual results: Expected results: Does this happen every time? Other information:
I experienced the same bug as reported by Adriano. If it helps, I can post you two files that will allow to reproduce the problem. My version of meld is 1.1.5 (shipped in fedora8) Maybe of interest: - the 'diff bar' on the side of the text window correctly highlight a diff, but pressing the Down button jumps to the second match. - meld file1 file2 does not behave as meld file2 file1 (I only get the problem one way) Can the priority/severity for this bug be escalated? I would dread missing some diff because of this 'navigation' issue I hope that can be fixed, meld is an excellent tool and extremely usefull
The problem seems to be within these lines in meld/filediff.py: HTH ## if c[1]+c1 == c[2]-c2: ## continue if c[1] > curline + 1: break else: #direction == gdk.SCROLL_UP for chunk in self.linediffer.single_changes(1, self._get_texts()): c1,c2 = self._consume_blank_lines( self._get_texts()[1][chunk[1]:chunk[2]] ) ## if chunk[1]+c1 == chunk[2]-c2: ## continue if chunk[2] < curline: c = chunk elif c: break
I believe this is the same problem as reported here: http://bugzilla.gnome.org/show_bug.cgi?id=538736 It didn't exist in version 1.1.4, but I'm seeing it in version 1.1.5.1. I rely extensively on Meld as my favourite difference viewer / manual merger, so I need to trust it to show me all of the differences when I scroll up and down via these arrows. This is a subtle bug that would trick me otherwise, so I've downgraded back to version 1.1.4 until it is fixed.
More precisely, line removals (lines that exist on the left side only) are not reachable with the up/down buttons except if it is the last change in the file. I guess there is something fishy with how _consume_blank_lines() is used.
Created attachment 115738 [details] [review] quick bugfix Here is a bugfix. Tested with two- and three way diffs. I have found related bugs on the way which I'd like to fix more intrusively. Perhaps by removing _consume_blank_lines. It would help if someone can tell me why blank lines within a single change are supposed to be consumed at all.
I have attached an better but more intrusive fix for the problem here to Bug #392640. My patch here is obsolete, unless you don't like the new one.
I think the problem might be that UP and DOWN (go to prev/next difference) only goes where there are differences (blue background) and not isolated blocks (green background). IMHO the jump (to next / prev difference) feature should jump to green zones too, because they are also very important in a comparison.
*** Bug 538736 has been marked as a duplicate of this bug. ***
A friend using Ubuntu Jaunty told that had been patched, at least he did not get the problem with two files that were causing the pb on my side. I look it up on the web and applied that patch.
Could you please attach the patch here? Or at least post the link to it...
I think I started from this link. Reading it all more carefully, I see `Patch by Martin Renold`, who posted on this thread earlier. What'd be great is one unified meld because when I pulled it from svn trunk last week, it was not obvious it was included. I really mean to say this constructively: meld is top-notch great. https://launchpad.net/ubuntu/jaunty/+source/meld/1.2-0ubuntu1
Just a reminder that I have updated my two-bugfixes-in-one patch at Bug #392640 to current svn again.
In current SVN, this bug should be fixed when the "Ignore blank lines" preference is turned off. When that preference is turned on, there are some remaining problems, so I'm leaving this open for now. Please test SVN and report any problems you experience with the blank lines preference turned off.
*** Bug 578119 has been marked as a duplicate of this bug. ***
I can confirm that this bug is fixed. With "Ignore blank lines" I found no remaining problems. With "ignore blank lines" enabled I found two issues left. One is Bug #392640. The other is that Meld skips blank lines with Ctrl-D/Ctrl-E if they appear in the right file, but stops at the change if they are in the left file. Both issues are really minor to me compared to the original bug.
Created attachment 132493 [details] regression test (left file)
Created attachment 132494 [details] regression test (right file)
The attached files are crafted to test all the different cases that used to be problematic.
Those test cases are great, thanks. I've just committed a fix to git head that, according to my testing and to the test cases, addresses all of the issues identified when "Ignore blank lines" is enabled. I'm closing this bug, but further testing is very welcome. Please file new bugs for any problems encountered. Thanks for the bug report.