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

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

[elpa] externals/ivy-hydra 6930d72 143/395: ivy.el (ivy--kill-current-ca


From: Basil L. Contovounesios
Subject: [elpa] externals/ivy-hydra 6930d72 143/395: ivy.el (ivy--kill-current-candidate): Specialize and fix for buffers
Date: Thu, 25 Feb 2021 08:31:50 -0500 (EST)

branch: externals/ivy-hydra
commit 6930d724d954759b962296a3332edfbc1e268673
Author: Ingo Lohmar <ingo.lohmar@posteo.net>
Commit: Oleh Krehel <ohwoeowho@gmail.com>

    ivy.el (ivy--kill-current-candidate): Specialize and fix for buffers
    
    When using `uniquify', killing a buffer does not only remove it from the
    buffer candidates, but can change the names of remaining buffers as
    well.  This fix was given by Oleh in an issue comment, and I updated it
    for the current master branch.
    
    Fixes #1609
    Fixes #2443
---
 ivy.el | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/ivy.el b/ivy.el
index f8d01ae..3841225 100644
--- a/ivy.el
+++ b/ivy.el
@@ -4455,13 +4455,20 @@ BUFFER may be a string or nil."
   (let ((ivy--recompute-index-inhibit t))
     (ivy--exhibit)))
 
+(defun ivy--kill-current-candidate-buffer ()
+  (setf (ivy-state-preselect ivy-last) ivy--index)
+  (setq ivy--old-re nil)
+  (setq ivy--all-candidates (ivy--buffer-list "" ivy-use-virtual-buffers nil))
+  (let ((ivy--recompute-index-inhibit t))
+    (ivy--exhibit)))
+
 (defun ivy--kill-buffer-action (buffer)
   "Kill BUFFER."
   (ivy--kill-buffer-or-virtual buffer)
   (unless (buffer-live-p (ivy-state-buffer ivy-last))
     (setf (ivy-state-buffer ivy-last)
           (with-ivy-window (current-buffer))))
-  (ivy--kill-current-candidate))
+  (ivy--kill-current-candidate-buffer))
 
 (defvar ivy-switch-buffer-map
   (let ((map (make-sparse-keymap)))



reply via email to

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