[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master aea4919 225/348: Shrink ivy back to ivy-height after dispa
From: |
Oleh Krehel |
Subject: |
[elpa] master aea4919 225/348: Shrink ivy back to ivy-height after dispatching actions. |
Date: |
Sat, 8 Apr 2017 11:04:01 -0400 (EDT) |
branch: master
commit aea4919c8e1c3abf9e513b462d64c0ed77c0480e
Author: Yevgnen Koh <address@hidden>
Commit: Oleh Krehel <address@hidden>
Shrink ivy back to ivy-height after dispatching actions.
Before when there are too many actions, ivy will not go back to
original ivy-height after a C-g in ivy-dispatching-done or
performing ivy-dispatching-call. The function
ivy-shrink-after-dispatching deals with these situations.
---
ivy.el | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/ivy.el b/ivy.el
index 1309da6..fb8feed 100644
--- a/ivy.el
+++ b/ivy.el
@@ -567,11 +567,17 @@ selection, non-nil otherwise."
(setcar actions (1+ action-idx))
(ivy-set-action actions)))))))
+(defun ivy-shrink-after-dispatching ()
+ "Shrink the window after dispatching when action list is too large."
+ (let ((window (selected-window)))
+ (window-resize window (- ivy-height (window-height window)))))
+
(defun ivy-dispatching-done ()
"Select one of the available actions and call `ivy-done'."
(interactive)
(when (ivy-read-action)
- (ivy-done)))
+ (ivy-done))
+ (ivy-shrink-after-dispatching))
(defun ivy-dispatching-call ()
"Select one of the available actions and call `ivy-call'."
@@ -581,7 +587,8 @@ selection, non-nil otherwise."
(unwind-protect
(when (ivy-read-action)
(ivy-call))
- (ivy-set-action actions))))
+ (ivy-set-action actions)))
+ (ivy-shrink-after-dispatching))
(defun ivy-build-tramp-name (x)
"Reconstruct X into a path.
- [elpa] master aedea1a 289/348: counsel.el (counsel-package): Add func to manage packages., (continued)
- [elpa] master aedea1a 289/348: counsel.el (counsel-package): Add func to manage packages., Oleh Krehel, 2017/04/08
- [elpa] master b9c52be 301/348: counsel.el (counsel-git): Add "x" action, Oleh Krehel, 2017/04/08
- [elpa] master dbeb5b1 303/348: Ensure counsel-M-x preserves last-command, Oleh Krehel, 2017/04/08
- [elpa] master ae3ca26 117/348: counsel.el (counsel-locate-action-extern): Add w32 support, Oleh Krehel, 2017/04/08
- [elpa] master 3e651a3 116/348: Make swiper-all use point positions instead of line positions, Oleh Krehel, 2017/04/08
- [elpa] master ef3f010 128/348: ivy.el (ivy--insert-prompt): Improve the extra "\n" logic, Oleh Krehel, 2017/04/08
- [elpa] master 870112e 176/348: counsel.el (counsel-ag-function): Use sync on remote, Oleh Krehel, 2017/04/08
- [elpa] master 1914ecd 203/348: counsel.el (counsel-recoll-function): Add shell-quote-argument, Oleh Krehel, 2017/04/08
- [elpa] master f0e49d5 213/348: Improve recursive minibuffers with two emacsclients, Oleh Krehel, 2017/04/08
- [elpa] master df9ad89 220/348: counsel.el (counsel-rpm): New command, Oleh Krehel, 2017/04/08
- [elpa] master aea4919 225/348: Shrink ivy back to ivy-height after dispatching actions.,
Oleh Krehel <=
- [elpa] master 88bf299 228/348: counsel.el (counsel-recentf): Remove properties from recentf-list, Oleh Krehel, 2017/04/08
- [elpa] master 576a1e3 232/348: Revert "ivy.el (ivy-call): setq default-directory instead of let", Oleh Krehel, 2017/04/08
- [elpa] master 50bb6b3 250/348: ivy.el (ivy-call): Call the action in ivy-state-buffer, Oleh Krehel, 2017/04/08
- [elpa] master f9f2c8c 251/348: counsel.el (counsel-bookmark-avoid-dired): Add, Oleh Krehel, 2017/04/08
- [elpa] master 123f9e1 258/348: swiper-all should consider magit stash buffers too, Oleh Krehel, 2017/04/08
- [elpa] master 4dd650c 257/348: Make counsel-ag prompt for extra args when using prefix arg., Oleh Krehel, 2017/04/08
- [elpa] master a77a265 263/348: Set `outline-regexp' directory local, Oleh Krehel, 2017/04/08
- [elpa] master 109170b 264/348: Remap `backward-delete-char-untabify' to `ivy-backward-delete-char', Oleh Krehel, 2017/04/08
- [elpa] master 039c58a 254/348: counsel.el: added three new counsel commands., Oleh Krehel, 2017/04/08
- [elpa] master 5b66c18 267/348: Update copyright year, Oleh Krehel, 2017/04/08