[gedit-plugins/gnome-2-32] Better handling of delete when in single column mode
- From: Jesse van den Kieboom <jessevdk src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gedit-plugins/gnome-2-32] Better handling of delete when in single column mode
- Date: Sun, 29 Aug 2010 22:53:58 +0000 (UTC)
commit 52771a6fbaae71e0ed38d28ba2eee7839a788df8
Author: Jesse van den Kieboom <jesse icecrew nl>
Date: Sat May 1 11:54:44 2010 +0200
Better handling of delete when in single column mode
plugins/multiedit/multiedit/documenthelper.py | 15 ++++++++++++++-
1 files changed, 14 insertions(+), 1 deletions(-)
---
diff --git a/plugins/multiedit/multiedit/documenthelper.py b/plugins/multiedit/multiedit/documenthelper.py
index 09d9ea4..0909e97 100644
--- a/plugins/multiedit/multiedit/documenthelper.py
+++ b/plugins/multiedit/multiedit/documenthelper.py
@@ -631,20 +631,33 @@ class DocumentHelper(Signals):
def handle_column_mode_delete(self, mark):
buf = self._buffer
start = buf.get_iter_at_mark(mark)
- buf.delete_mark(mark)
self._view.set_editable(True)
# Reinsert what was deleted, and apply column mode
self.block_signal(buf, 'insert-text')
+ singlecolumn = self._column_mode[2] == self._column_mode[3]
+
buf.begin_user_action()
buf.insert(start, self._delete_text)
+
+ start = buf.get_iter_at_mark(mark)
+ buf.delete_mark(mark)
+
self._apply_column_mode()
buf.end_user_action()
self.unblock_signal(buf, 'insert-text')
self._delete_mode_id = 0
+
+ if singlecolumn:
+ # Redo the delete actually
+ end = start.copy()
+ end.forward_char()
+
+ buf.delete(start, end)
+
return False
def on_delete_range(self, buf, start, end):
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]