[meld] Fix delete and copy up linkmap actions at EOF
- From: Kai Willadsen <kaiw src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [meld] Fix delete and copy up linkmap actions at EOF
- Date: Fri, 14 Aug 2009 03:17:38 +0000 (UTC)
commit 30b95069f42960738768ad48f424d8621917e40b
Author: Piotr Piastucki <leech miranda gmail com>
Date: Mon Aug 10 18:16:17 2009 +0200
Fix delete and copy up linkmap actions at EOF
filediff.py | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/filediff.py b/filediff.py
index 25a5c86..1adb849 100644
--- a/filediff.py
+++ b/filediff.py
@@ -1343,10 +1343,15 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
b0 = self.textbuffer[src]
b1 = self.textbuffer[dst]
if self.keymask & MASK_SHIFT: # delete
- b0.delete(get_iter_at_line_or_eof(b0, chunk[0]), get_iter_at_line_or_eof(b0, chunk[1]))
+ it = get_iter_at_line_or_eof(b0, chunk[0])
+ if chunk[1] >= b0.get_line_count():
+ it.backward_char()
+ b0.delete(it, get_iter_at_line_or_eof(b0, chunk[1]))
elif self.keymask & MASK_CTRL: # copy up or down
t0 = b0.get_text( get_iter_at_line_or_eof(b0, chunk[0]), get_iter_at_line_or_eof(b0, chunk[1]), 0)
if event.y - rect[1] < 0.5 * rect[3]: # copy up
+ if chunk[1] >= b0.get_line_count() and chunk[2] < b1.get_line_count():
+ t0 = t0 + "\n"
insert_with_tags_by_name(b1, chunk[2], t0, "edited line")
else: # copy down
insert_with_tags_by_name(b1, chunk[3], t0, "edited line")
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]