]> code.delx.au - gnu-emacs-elpa/blobdiff - packages/diff-hl/diff-hl.el
Merge commit '9d4a005a34458419025162224c9daf8d674142c8'
[gnu-emacs-elpa] / packages / diff-hl / diff-hl.el
index 8790352f10dad28b882affc7d6a474013aa5a3b6..b8407884e384b5ec9fc617eb27f2d495b7b84912 100644 (file)
@@ -1,11 +1,11 @@
-;;; diff-hl.el --- Highlight uncommitted changes -*- lexical-binding: t -*-
+;;; diff-hl.el --- Highlight uncommitted changes using VC -*- lexical-binding: t -*-
 
-;; Copyright (C) 2012-2015  Free Software Foundation, Inc.
+;; Copyright (C) 2012-2016  Free Software Foundation, Inc.
 
 ;; Author:   Dmitry Gutov <dgutov@yandex.ru>
 ;; URL:      https://github.com/dgutov/diff-hl
 ;; Keywords: vc, diff
-;; Version:  1.8.0
+;; Version:  1.8.2
 ;; Package-Requires: ((cl-lib "0.2"))
 
 ;; This file is part of GNU Emacs.
@@ -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"))
@@ -414,7 +417,7 @@ in the source file, or the last line of the hunk above it."
               (with-current-buffer ,buffer
                 (save-buffer))
               (message "Hunk reverted"))))
-      (quit-windows-on diff-buffer))))
+      (quit-windows-on diff-buffer t))))
 
 (defun diff-hl-hunk-overlay-at (pos)
   (cl-loop for o in (overlays-in pos (1+ pos))