From 82fd5b943bda0cf9c99d615a7d78fdae3d8f73e7 Mon Sep 17 00:00:00 2001 From: Andrey Kotlarski Date: Sat, 18 Jan 2014 16:26:25 +0200 Subject: [PATCH] Refine diff adjustment and in case of equality after it - make another search for difference. --- vlf-base.el | 2 +- vlf-ediff.el | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/vlf-base.el b/vlf-base.el index 68f098e..c6da794 100644 --- a/vlf-base.el +++ b/vlf-base.el @@ -168,7 +168,7 @@ bytes added to the end." (point-max))))))) (cond ((< vlf-start-pos start) (let* ((del-pos (byte-to-position - (- start vlf-start-pos))) + (1+ (- start vlf-start-pos)))) (del-len (length (encode-coding-region (point-min) del-pos buffer-file-coding-system diff --git a/vlf-ediff.el b/vlf-ediff.el index 24d807e..b16942a 100644 --- a/vlf-ediff.el +++ b/vlf-ediff.el @@ -177,6 +177,9 @@ of difference list." (when (< 0 ediff-number-of-differences) (vlf-ediff-adjust buffer-A buffer-B t) (vlf-ediff-adjust buffer-A buffer-B) + (if (< 0 ediff-number-of-differences) + (save-excursion + (vlf-ediff-next buffer-A buffer-B 'vlf-next-chunk))) (ediff-jump-to-difference 1))) ad-do-it)) @@ -198,6 +201,9 @@ beginning of difference list." (when (< 0 ediff-number-of-differences) (vlf-ediff-adjust buffer-A buffer-B) (vlf-ediff-adjust buffer-A buffer-B t) + (if (< 0 ediff-number-of-differences) + (save-excursion + (vlf-ediff-next buffer-A buffer-B 'vlf-prev-chunk))) (ediff-jump-to-difference -1))) ad-do-it))