[jhbuild: 55/60] [gui] reuse existing text mark for scrolling to the end



commit 0db795d00c8c048dd585fa96eb0cdbe2be668101
Author: Frédéric Péters <fpeters 0d be>
Date:   Sat Jun 6 12:27:00 2009 +0200

    [gui] reuse existing text mark for scrolling to the end
---
 jhbuild/frontends/gtkui.py |    7 +++++--
 1 files changed, 5 insertions(+), 2 deletions(-)

diff --git a/jhbuild/frontends/gtkui.py b/jhbuild/frontends/gtkui.py
index dae8234..93c378b 100644
--- a/jhbuild/frontends/gtkui.py
+++ b/jhbuild/frontends/gtkui.py
@@ -511,10 +511,13 @@ class AppWindow(gtk.Window, buildscript.BuildScript):
                     textbuffer.insert_with_tags_by_name(
                             textbuffer.get_end_iter(), chunk, 'stderr')
 
-                mark = textbuffer.create_mark('end', textbuffer.get_end_iter(), False)
+                mark = textbuffer.get_mark('end')
+                if mark:
+                    mark.move_mark(textbuffer.get_end_iter())
+                else:
+                    mark = textbuffer.create_mark('end', textbuffer.get_end_iter(), False)
                 self.terminal.scroll_to_mark(mark, 0.05, True, 0.0, 1.0)
 
-
                 # See if we should pause the current command
                 if not build_paused and self.is_build_paused():
                     os.kill(p.pid, signal.SIGSTOP)



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