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

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

[elpa] externals/ivy-posframe 7bd5b91 1/4: Fix minibuffer height is incr


From: Feng Shu
Subject: [elpa] externals/ivy-posframe 7bd5b91 1/4: Fix minibuffer height is increased after closing action list #103
Date: Mon, 14 Dec 2020 19:40:02 -0500 (EST)

branch: externals/ivy-posframe
commit 7bd5b9101994132d84c3c36c9a6d9e0fc2743f23
Author: SeungKi Kim <tttuuu888@gmail.com>
Commit: SeungKi Kim <tttuuu888@gmail.com>

    Fix minibuffer height is increased after closing action list #103
---
 ivy-posframe.el | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/ivy-posframe.el b/ivy-posframe.el
index f9e59b6..4364a74 100644
--- a/ivy-posframe.el
+++ b/ivy-posframe.el
@@ -332,11 +332,19 @@ This variable is useful for `ivy-posframe-read-action' .")
 (declare-function swiper-avy "swiper")
 (declare-function swiper--update-input-ivy "swiper")
 
+(defun ivy--posframe-dispatching-done ()
+  "Select one of the available actions and call `ivy-done'."
+  (interactive)
+  (let ((ivy-exit 'ivy--posframe-dispatching-done))
+    (when (ivy-read-action)
+      (ivy-done)))
+  (ivy-posframe-shrink-after-dispatching))
+
 (defun ivy-posframe-dispatching-done ()
   "Ivy-posframe's `ivy-dispatching-done'."
   (interactive)
   (let ((ivy-read-action-function #'ivy-posframe-read-action-by-key))
-    (ivy-dispatching-done)))
+    (ivy--posframe-dispatching-done)))
 
 (defun ivy-posframe-read-action ()
   "Ivy-posframe version `ivy-read-action'"
@@ -369,7 +377,7 @@ This variable is useful for `ivy-posframe-read-action' .")
                                      (funcall display-function hint)
                                      "Please type a key: ")
                                  hint)))))))
-    (ivy-shrink-after-dispatching)
+    (ivy-posframe-shrink-after-dispatching)
     (cond ((member key '("ESC" "C-g" "M-o"))
            nil)
           ((null action-idx)
@@ -380,6 +388,11 @@ This variable is useful for `ivy-posframe-read-action' .")
            (setcar actions (1+ action-idx))
            (ivy-set-action actions)))))
 
+(defun ivy-posframe-shrink-after-dispatching ()
+  "Shrink the minibuffer to the minimum size after dispatching."
+  (when (window-minibuffer-p)
+    (window-resize nil (- (window-size)))))
+
 (defun ivy-posframe--window ()
   "Return the posframe window displaying `ivy-posframe-buffer'."
   (frame-selected-window



reply via email to

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