[meld] Warp the text cursor at the start of the diff chunk we just jumped to.



commit af110baa24e07ba6c00a1d340a76ff1a17051886
Author: Vincent Legoll <vincent legoll gmail com>
Date:   Sat May 2 12:37:24 2009 +0200

    Warp the text cursor at the start of the diff chunk we just jumped to.
    
    "Which is probably what users want anyways."
    Dixit Stephen, in http://bugzilla.gnome.org/show_bug.cgi?id=458372#c14
    and the user that I also am agrees.
---
 filediff.py |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/filediff.py b/filediff.py
index f2e5839..ee676a2 100644
--- a/filediff.py
+++ b/filediff.py
@@ -1076,6 +1076,9 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
             want = 0.5 * ( self._line_to_pixel(aidx, l0) + self._line_to_pixel(aidx,l1) - a.page_size )
             want = misc.clamp(want, 0, a.upper-a.page_size)
             a.set_value( want )
+            # Warp the cursor at the start of the diff chunk we jumped to
+            buf = self._get_focused_textview().get_buffer()
+            buf.place_cursor(buf.get_iter_at_line(l0))
 
     def _consume_blank_lines(self, txt):
         lo, hi = 0, 0



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]