summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgnacio Casal Quinteiro <icq@gnome.org>2011-02-17 10:42:56 +0100
committerIgnacio Casal Quinteiro <icq@gnome.org>2011-02-17 10:47:57 +0100
commit3faf6d6191a5de7e6014bf3a66987d506f01183a (patch)
tree5665ad47a657678dd90a07fcdc27aac8515b079e
parent6da33d0d064e7dd6b5144d01ea1d73a8cde5b02d (diff)
downloadtotem-3faf6d6191a5de7e6014bf3a66987d506f01183a.tar.gz
fix insertion with tags
-rw-r--r--src/plugins/pythonconsole/console.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/plugins/pythonconsole/console.py b/src/plugins/pythonconsole/console.py
index f17e85ec7..f1e6bdd76 100644
--- a/src/plugins/pythonconsole/console.py
+++ b/src/plugins/pythonconsole/console.py
@@ -239,11 +239,12 @@ class PythonConsole(Gtk.ScrolledWindow):
return False
def write(self, text, tag = None):
- buffer = self.view.get_buffer()
- insertion_iter = buffer.get_end_iter()
- buffer.insert(insertion_iter, text)
- if tag is not None:
- buffer.apply_tag(tag, insertion_iter, buffer.get_end_iter())
+ buf = self.view.get_buffer()
+ if tag is None:
+ buf.insert(buf.get_end_iter(), text)
+ else:
+ buf.insert_with_tags(buf.get_end_iter(), text, tag)
+
gobject.idle_add(self.scroll_to_end)
def eval(self, command, display_command = False):