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

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

[elpa] externals/ivy-posframe ebf1296 3/4: Merge pull request #106 from


From: Feng Shu
Subject: [elpa] externals/ivy-posframe ebf1296 3/4: Merge pull request #106 from tttuuu888/work-issue-103
Date: Mon, 14 Dec 2020 19:40:02 -0500 (EST)

branch: externals/ivy-posframe
commit ebf1296417eba1cf947bef1f7a172fb62364bdb9
Merge: 96fde5a ba58f6e
Author: tumashu <tumashu@163.com>
Commit: GitHub <noreply@github.com>

    Merge pull request #106 from tttuuu888/work-issue-103
    
    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 42c9dc2..918e6be 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]