[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/diff-hl 09ffe8d 21/25: Introduce diff-hl-update-once, t
From: |
Dmitry Gutov |
Subject: |
[elpa] externals/diff-hl 09ffe8d 21/25: Introduce diff-hl-update-once, to avoid diffing twice in normal-mode |
Date: |
Sun, 20 Dec 2020 05:07:04 -0500 (EST) |
branch: externals/diff-hl
commit 09ffe8dce1af5fe32ab6e12e3a424504db365700
Author: Dmitry Gutov <dgutov@yandex.ru>
Commit: Dmitry Gutov <dgutov@yandex.ru>
Introduce diff-hl-update-once, to avoid diffing twice in normal-mode
Fixes #152
---
diff-hl.el | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/diff-hl.el b/diff-hl.el
index 0f59263..11d9850 100644
--- a/diff-hl.el
+++ b/diff-hl.el
@@ -358,6 +358,15 @@ performance when viewing such files in certain conditions."
(overlay-put h 'insert-in-front-hooks hook)
(overlay-put h 'insert-behind-hooks hook)))))))))
+(defvar-local diff-hl--modified-tick nil)
+
+(put 'diff-hl--modified-tick 'permanent-local t)
+
+(defun diff-hl-update-once ()
+ (unless (equal diff-hl--modified-tick (buffer-chars-modified-tick))
+ (diff-hl-update)
+ (setq diff-hl--modified-tick (buffer-chars-modified-tick))))
+
(defun diff-hl-add-highlighting (type shape)
(let ((o (make-overlay (point) (point))))
(overlay-put o 'diff-hl t)
@@ -571,7 +580,7 @@ The value of this variable is a mode line template as in
;; let's wait until the state information is
;; saved, in order not to fetch it twice.
'find-file-hook)
- 'diff-hl-update t t)
+ 'diff-hl-update-once t t)
(add-hook 'vc-checkin-hook 'diff-hl-update nil t)
;; https://github.com/magit/magit/issues/603
(add-hook 'magit-revert-buffer-hook 'diff-hl-update nil t)
- [elpa] externals/diff-hl 2281a89 17/25: Update docstring and untabify, (continued)
- [elpa] externals/diff-hl 2281a89 17/25: Update docstring and untabify, Dmitry Gutov, 2020/12/20
- [elpa] externals/diff-hl a625033 10/25: Update Magit bridge to use the recommended approach, Dmitry Gutov, 2020/12/20
- [elpa] externals/diff-hl f3b2d15 11/25: diff-hl-diff-goto-hunk, diff-hl-revert-hunk: handle indirect buffers., Dmitry Gutov, 2020/12/20
- [elpa] externals/diff-hl 176f931 14/25: Support buffers in 'conflict' state as well, Dmitry Gutov, 2020/12/20
- [elpa] externals/diff-hl 165a30f 16/25: Merge pull request #143 from walseb/master, Dmitry Gutov, 2020/12/20
- [elpa] externals/diff-hl c58098c 15/25: Added option to not automatically enable diff-hl in certain major-modes, Dmitry Gutov, 2020/12/20
- [elpa] externals/diff-hl d1b9a2b 18/25: Add global-diff-hl-amend-mode to diff-hl custom group, Dmitry Gutov, 2020/12/20
- [elpa] externals/diff-hl c31af59 20/25: Don't hook into after-revert-hook, Dmitry Gutov, 2020/12/20
- [elpa] externals/diff-hl 8ed1120 22/25: Revert "Don't hook into after-revert-hook", Dmitry Gutov, 2020/12/20
- [elpa] externals/diff-hl f6244ab 19/25: Merge pull request #150 from tarsiiformes/custom-group, Dmitry Gutov, 2020/12/20
- [elpa] externals/diff-hl 09ffe8d 21/25: Introduce diff-hl-update-once, to avoid diffing twice in normal-mode,
Dmitry Gutov <=
- [elpa] externals/diff-hl 328e23e 23/25: Introduce diff-hl-after-revert, Dmitry Gutov, 2020/12/20
- [elpa] externals/diff-hl b8b4f43 24/25: Bump the version, Dmitry Gutov, 2020/12/20
- [elpa] externals/diff-hl a0028d9 25/25: Merge branch 'externals/diff-hl' of git+ssh://git.sv.gnu.org/srv/git/emacs/elpa, Dmitry Gutov, 2020/12/20