[gedit-plugins] 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] Better handling of delete when in single column mode
- Date: Sat, 1 May 2010 10:54:56 +0000 (UTC)
commit 7000bb620dfb3dcea829fa450279cafeef4fbcde
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 21cba13..541c3cd 100644
--- a/plugins/multiedit/multiedit/documenthelper.py
+++ b/plugins/multiedit/multiedit/documenthelper.py
@@ -610,20 +610,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]