[gedit-plugins] Make multi edit keybinding toggle multi edit mode
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit-plugins] Make multi edit keybinding toggle multi edit mode
- Date: Sat, 1 May 2010 15:10:54 +0000 (UTC)
commit 058bb34dedc16ae6d19ddee0027dff3f18b83786
Author: Jesse van den Kieboom <jesse icecrew nl>
Date: Sat May 1 17:10:42 2010 +0200
Make multi edit keybinding toggle multi edit mode
plugins/multiedit/multiedit/documenthelper.py | 26 +++++++++++++-----------
plugins/multiedit/multiedit/windowhelper.py | 2 +-
2 files changed, 15 insertions(+), 13 deletions(-)
---
diff --git a/plugins/multiedit/multiedit/documenthelper.py b/plugins/multiedit/multiedit/documenthelper.py
index d34fe4e..8f107ce 100644
--- a/plugins/multiedit/multiedit/documenthelper.py
+++ b/plugins/multiedit/multiedit/documenthelper.py
@@ -146,13 +146,24 @@ class DocumentHelper(Signals):
for handler in self._event_handlers:
handler[0] = map(lambda x: gtk.gdk.keyval_from_name(x), handler[0])
+ def disable_multi_edit(self):
+ if self._column_mode:
+ self._cancel_column_mode()
+
+ self._in_mode = False
+
+ self._view.set_border_window_size(gtk.TEXT_WINDOW_TOP, 0)
+ self.remove_edit_points()
+
def enable_multi_edit(self):
self._view.set_border_window_size(gtk.TEXT_WINDOW_TOP, 20)
+ self._in_mode = True
+ def toggle_multi_edit(self):
if self._in_mode:
- return
-
- self._in_mode = True
+ self.disable_multi_edit()
+ else:
+ self.enable_multi_edit()
def remove_edit_points(self):
buf = self._buffer
@@ -164,15 +175,6 @@ class DocumentHelper(Signals):
self._multi_edited = False
self._view.queue_draw()
- def disable_multi_edit(self):
- if self._column_mode:
- self._cancel_column_mode()
-
- self._in_mode = False
-
- self._view.set_border_window_size(gtk.TEXT_WINDOW_TOP, 0)
- self.remove_edit_points()
-
def do_escape_mode(self, event):
if self._column_mode:
self._cancel_column_mode()
diff --git a/plugins/multiedit/multiedit/windowhelper.py b/plugins/multiedit/multiedit/windowhelper.py
index b02b4e6..bb80132 100644
--- a/plugins/multiedit/multiedit/windowhelper.py
+++ b/plugins/multiedit/multiedit/windowhelper.py
@@ -115,6 +115,6 @@ class WindowHelper(Signals):
helper = view.get_data(constants.DOCUMENT_HELPER_KEY)
if helper != None:
- helper.enable_multi_edit()
+ helper.toggle_multi_edit()
# ex:ts=4:et:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]