[Top][All Lists]

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

[elpa] externals/diff-hl 96ef17a 1/4: bury show hunk buffers on quit

From: ELPA Syncer
Subject: [elpa] externals/diff-hl 96ef17a 1/4: bury show hunk buffers on quit
Date: Sat, 3 Jul 2021 15:57:10 -0400 (EDT)

branch: externals/diff-hl
commit 96ef17a9c962469f60c0cc5c107f71bb4a7bbdad
Author: Jimmy Yuen Ho Wong <wyuenho@gmail.com>
Commit: Jimmy Yuen Ho Wong <wyuenho@gmail.com>

    bury show hunk buffers on quit
 diff-hl-show-hunk.el | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/diff-hl-show-hunk.el b/diff-hl-show-hunk.el
index f4945de..ee047bf 100644
--- a/diff-hl-show-hunk.el
+++ b/diff-hl-show-hunk.el
@@ -49,7 +49,10 @@
   "Keymap for command `diff-hl-show-hunk-mouse-mode'.")
 (defvar diff-hl-show-hunk-buffer-name "*diff-hl-show-hunk-buffer*"
-  "Name of the posframe used by diff-hl-show-hunk.")
+  "Name of the buffer used by diff-hl-show-hunk.")
+(defvar diff-hl-show-hunk-diff-buffer-name "*diff-hl-show-hunk-diff-buffer*"
+  "Name of the buffer used by diff-hl-show-hunk to show the diff.")
 (defvar diff-hl-show-hunk--original-window nil
   "The vc window of which the hunk is shown.")
@@ -105,6 +108,8 @@ corresponding to the clicked line in the original buffer."
   (with-current-buffer (get-buffer-create diff-hl-show-hunk-buffer-name)
     (read-only-mode -1)
+  (bury-buffer diff-hl-show-hunk-buffer-name)
+  (bury-buffer diff-hl-show-hunk-diff-buffer-name)
   (when diff-hl-show-hunk--hide-function
     (let ((hidefunc diff-hl-show-hunk--hide-function))
       (setq diff-hl-show-hunk--hide-function nil)
@@ -127,7 +132,7 @@ buffer."
   (defvar vc-sentinel-movepoint)
   (let* ((buffer (or (buffer-base-buffer) (current-buffer)))
          (line (line-number-at-pos))
-         (dest-buffer "*diff-hl-show-hunk-diff-buffer*"))
+         (dest-buffer diff-hl-show-hunk-diff-buffer-name))
     (with-current-buffer buffer
       (diff-hl-diff-buffer-with-reference (buffer-file-name buffer) 
       (switch-to-buffer dest-buffer)

reply via email to

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