emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] scratch/add-vdiff 4d5299e 031/258: Fix alignment of folds next to


From: Justin Burkett
Subject: [elpa] scratch/add-vdiff 4d5299e 031/258: Fix alignment of folds next to subtractions
Date: Wed, 17 May 2017 08:13:17 -0400 (EDT)

branch: scratch/add-vdiff
commit 4d5299e9287e0d05e5297fce73f886b76c33f539
Author: justbur <address@hidden>
Commit: justbur <address@hidden>

    Fix alignment of folds next to subtractions
---
 vdiff.el | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

diff --git a/vdiff.el b/vdiff.el
index 2f55b2a..509cb7d 100644
--- a/vdiff.el
+++ b/vdiff.el
@@ -332,9 +332,7 @@ lines hidden."
 (defun vdiff--add-subtraction-overlays (buffer start-line target-range amount)
   (with-current-buffer buffer
     (vdiff--move-to-line start-line)
-    (end-of-line)
-    (let* ((position (1+ (point)))
-           (ovr (make-overlay position (1+ position))))
+    (let* ((ovr (make-overlay (point) (1+ (point)))))
       (overlay-put ovr 'before-string 
                    (vdiff--make-subtraction-string amount))
       (overlay-put ovr 'vdiff-target-range target-range)
@@ -436,6 +434,12 @@ lines hidden."
                (b-norm-range (cons b-beg b-end))
                (b-length (1+ (- b-end b-beg))))
 
+          ;; Adjust line number for subtractions
+          (when (string= code "a")
+            (cl-incf a-beg))
+          (when (string= code "d")
+            (cl-incf b-beg))
+          
           (vdiff--add-folds
            a-buffer b-buffer
            (cons a-last-post-end (1- a-beg))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]