[gedit] Use the new override for insert_with_tags.
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit] Use the new override for insert_with_tags.
- Date: Tue, 18 Jan 2011 10:42:07 +0000 (UTC)
commit 9051b9fbe172f291001a286ee0f10d0a209d3490
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Tue Jan 18 11:40:17 2011 +0100
Use the new override for insert_with_tags.
plugins/pythonconsole/pythonconsole/config.py | 2 +-
plugins/pythonconsole/pythonconsole/console.py | 14 +++++---------
2 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/plugins/pythonconsole/pythonconsole/config.py b/plugins/pythonconsole/pythonconsole/config.py
index 8257a4d..97e0c5c 100644
--- a/plugins/pythonconsole/pythonconsole/config.py
+++ b/plugins/pythonconsole/pythonconsole/config.py
@@ -27,7 +27,7 @@
import os
from gi.repository import Gio, Gtk, Gdk
-__all__ = ('PythonConsoleConfigDialog')
+__all__ = ('PythonConsoleConfigWidget')
class PythonConsoleConfigWidget(object):
diff --git a/plugins/pythonconsole/pythonconsole/console.py b/plugins/pythonconsole/pythonconsole/console.py
index 69eb969..f02bb3a 100644
--- a/plugins/pythonconsole/pythonconsole/console.py
+++ b/plugins/pythonconsole/pythonconsole/console.py
@@ -335,15 +335,11 @@ class PythonConsole(Gtk.ScrolledWindow):
def write(self, text, tag = None):
buf = self.view.get_buffer()
- #FIXME
- #if tag is None:
- # buf.insert(buf.get_end_iter(), text)
- #else:
- # buf.insert_with_tags(buf.get_end_iter(), text, tag)
- insertion_iter = buf.get_end_iter()
- buf.insert(insertion_iter, text)
- if tag is not None:
- buf.apply_tag(tag, insertion_iter, buf.get_end_iter())
+ 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]