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

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

[elpa] scratch/add-vdiff 371febc 135/258: Add option to automatically re


From: Justin Burkett
Subject: [elpa] scratch/add-vdiff 371febc 135/258: Add option to automatically refine hunks
Date: Wed, 17 May 2017 08:13:38 -0400 (EDT)

branch: scratch/add-vdiff
commit 371febcf9566086bb2c585f94edba70b7cb2a938
Author: Ivan Andrus <address@hidden>
Commit: Ivan Andrus <address@hidden>

    Add option to automatically refine hunks
---
 vdiff.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/vdiff.el b/vdiff.el
index dd96296..11e8db2 100644
--- a/vdiff.el
+++ b/vdiff.el
@@ -104,6 +104,11 @@ 
https://www.gnu.org/software/emacs/manual/html_node/elisp/Syntax-Class-Table.htm
   :group 'vdiff
   :type 'string)
 
+(defcustom vdiff-auto-refine t
+  "If non-nil, automatically refine all hunks."
+  :group 'vdiff
+  :type 'bool)
+
 (defcustom vdiff-subtraction-style 'full
   "How to represent subtractions (i.e., deleted lines). The
 default is full which means add the same number of (fake) lines
@@ -390,7 +395,9 @@ parsing the diff output and triggering the overlay updates."
         (vdiff--refresh-overlays)
         (vdiff--refresh-line-maps)
         (delete-file (process-get proc 'vdiff-tmp-a))
-        (delete-file (process-get proc 'vdiff-tmp-b))))
+        (delete-file (process-get proc 'vdiff-tmp-b))
+        (when vdiff-auto-refine
+          (vdiff-refine-all-hunks))))
     (setq vdiff--diff-stale nil)))
 
 (defun vdiff--remove-all-overlays ()



reply via email to

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