[meld] filediff: Place cursor at the start of a replaced chunk
- From: Kai Willadsen <kaiw src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [meld] filediff: Place cursor at the start of a replaced chunk
- Date: Sat, 11 Mar 2017 01:54:54 +0000 (UTC)
commit 27fd840ded3e17211591b4853b8bd364761b0aea
Author: Kai Willadsen <kai willadsen gmail com>
Date: Sat Mar 11 11:45:44 2017 +1000
filediff: Place cursor at the start of a replaced chunk
This is an ergonomics improvement. In most cases this won't matter at
all. It's sort of more intuitive to keep doing what we used to do, and
place the cursor after the chunk that's just had the action done to
it... after all that's what would happen if you'd just pasted the chunk.
However, it doesn't really feel right to me. In particular, it's a pain
when pulling chunks, because you've just pulled a chunk into your
current pane, and then your cursor is moved off this chunk. Now maybe
that's okay because you're done with it, but maybe you're not. You may
want to edit that chunk further, or (in three-way diff cases) you may
want to then push that chunk to the other side (i.e., in center, pull
from left, push to right).
If this doesn't end up working out, the change is trivial to revert.
However, for now this feels more correct to me.
meld/filediff.py | 1 +
1 files changed, 1 insertions(+), 0 deletions(-)
---
diff --git a/meld/filediff.py b/meld/filediff.py
index 974886b..12a5678 100644
--- a/meld/filediff.py
+++ b/meld/filediff.py
@@ -1800,6 +1800,7 @@ class FileDiff(melddoc.MeldDoc, gnomeglade.Component):
b1.begin_user_action()
b1.delete(dst_start, dst_end)
new_end = b1.insert_at_line(chunk[3], t0)
+ b1.place_cursor(b1.get_iter_at_line(chunk[3]))
b1.end_user_action()
mark1 = b1.create_mark(None, new_end, True)
if chunk[1] == chunk[2]:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]