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

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

[elpa] master 4da5eff 1/3: diff-hl-revert-hunk: Refine the right hunk


From: Dmitry Gutov
Subject: [elpa] master 4da5eff 1/3: diff-hl-revert-hunk: Refine the right hunk
Date: Sat, 31 Oct 2015 02:42:17 +0000

branch: master
commit 4da5eff696b23e52642aa5ee154531f693a35695
Author: Dmitry Gutov <address@hidden>
Commit: Dmitry Gutov <address@hidden>

    diff-hl-revert-hunk: Refine the right hunk
    
    Closes #35
---
 diff-hl.el |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/diff-hl.el b/diff-hl.el
index 8790352..61272d5 100644
--- a/diff-hl.el
+++ b/diff-hl.el
@@ -391,7 +391,8 @@ in the source file, or the last line of the hunk above it."
               (when (eobp)
                 (with-current-buffer ,buffer (diff-hl-remove-overlays))
                 (error "Buffer is up-to-date"))
-              (diff-hl-diff-skip-to ,line)
+              (let (diff-auto-refine-mode)
+                (diff-hl-diff-skip-to ,line))
               (save-excursion
                 (while (looking-at "[-+]") (forward-line 1))
                 (setq end-line (line-number-at-pos (point)))
@@ -406,6 +407,8 @@ in the source file, or the last line of the hunk above it."
                 (if (>= wbh (- end-line beg-line))
                     (recenter (/ (+ wbh (- beg-line end-line) 2) 2))
                   (recenter 1)))
+              (when diff-auto-refine-mode
+                (diff-refine-hunk))
               (unless (yes-or-no-p (format "Revert current hunk in %s?"
                                            ,(cl-caadr fileset)))
                 (error "Revert canceled"))



reply via email to

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