[meld] Reset cursor to top of each buffer on load



commit 51cff25ef55250c4c099021edfb9de5b30489453
Author: Kai Willadsen <kai willadsen gmail com>
Date:   Thu Apr 21 07:41:24 2011 +1000

    Reset cursor to top of each buffer on load
    
    While this is generally not relevant, keyboard focus changes can expose
    odd behaviour where non-central buffers have their cursors at the end of
    the buffer.

 meld/filediff.py |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index 430b621..ebf3b4b 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -959,7 +959,8 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
         self.cursor.next = chunk
         if self.cursor.next is None:
             self.cursor.next = next
-        self.textbuffer[1].place_cursor(self.textbuffer[1].get_start_iter())
+        for buf in self.textbuffer:
+            buf.place_cursor(buf.get_start_iter())
         self.scheduler.add_task(lambda: self.next_diff(gtk.gdk.SCROLL_DOWN), True)
         self.queue_draw()
         self.update_highlighting()



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