[gtksourceview] Remove marks when loading a file.



commit d57564194ddc6ed74ca42f23ca049d5a4af5a7dd
Author: Ignacio Casal Quinteiro <icq gnome org>
Date:   Mon Jun 21 00:48:12 2010 +0200

    Remove marks when loading a file.

 tests/test-widget.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/tests/test-widget.py b/tests/test-widget.py
index fffa824..9463247 100644
--- a/tests/test-widget.py
+++ b/tests/test-widget.py
@@ -244,6 +244,10 @@ class Window(Gtk.Window):
                                                          self.mark_tooltip_func,
                                                          None)
 
+    def remove_all_marks(self):
+        start, end = self._buf.get_bounds()
+        self._buf.remove_source_marks(start, end, None)
+
     def mark_tooltip_func(self, mark, user_data):
         i = self._buf.get_iter_at_mark(mark)
         line = i.get_line() + 1
@@ -411,6 +415,7 @@ class Window(Gtk.Window):
 
         print language
 
+        self.remove_all_marks()
         self._buf.set_language(language)
         self._buf.set_highlight_syntax(True)
 



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