[totem] fix insertion with tags



commit 3faf6d6191a5de7e6014bf3a66987d506f01183a
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Thu Feb 17 10:42:56 2011 +0100

    fix insertion with tags

 src/plugins/pythonconsole/console.py |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)
---
diff --git a/src/plugins/pythonconsole/console.py b/src/plugins/pythonconsole/console.py
index f17e85e..f1e6bdd 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):



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