[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 7a0b243 130/272: Give ivy-read-read-action enough minibuff
From: |
Oleh Krehel |
Subject: |
[elpa] master 7a0b243 130/272: Give ivy-read-read-action enough minibuffer space |
Date: |
Mon, 25 Apr 2016 10:13:21 +0000 |
branch: master
commit 7a0b24302e9f0d04ce775120da2520eb9de66fa0
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
Give ivy-read-read-action enough minibuffer space
* ivy.el (ivy-read-action): Bind (resize-mini-windows 'grow-only).
Return non-nil when everything went OK.
(ivy-dispatching-done): Call `ivy-done' only if read-action went OK.
Previously, an action would be called after "M-o C-g".
Fixes #402
---
ivy.el | 19 +++++++++++++------
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/ivy.el b/ivy.el
index 15c760c..5e59717 100644
--- a/ivy.el
+++ b/ivy.el
@@ -430,10 +430,14 @@ When non-nil, it should contain at least one %d.")
(ivy--exhibit))))
(defun ivy-read-action ()
- "Change the action to one of the available ones."
+ "Change the action to one of the available ones.
+
+Return nil for `minibuffer-keyboard-quit' or wrong key during the
+selection, non-nil otherwise."
(interactive)
(let ((actions (ivy-state-action ivy-last)))
- (unless (null (ivy--actionp actions))
+ (if (null (ivy--actionp actions))
+ t
(let* ((hint (concat (if (eq this-command 'ivy-read-action)
"Select action: "
ivy--current)
@@ -448,13 +452,16 @@ When non-nil, it should contain at least one %d.")
(cdr actions)
"\n")
"\n"))
+ (resize-mini-windows 'grow-only)
(key (string (read-key hint)))
(action-idx (cl-position-if
(lambda (x) (equal (car x) key))
(cdr actions))))
- (cond ((string= key ""))
+ (cond ((string= key "")
+ nil)
((null action-idx)
- (error "%s is not bound" key))
+ (message "%s is not bound" key)
+ nil)
(t
(message "")
(setcar actions (1+ action-idx))
@@ -463,8 +470,8 @@ When non-nil, it should contain at least one %d.")
(defun ivy-dispatching-done ()
"Select one of the available actions and call `ivy-done'."
(interactive)
- (ivy-read-action)
- (ivy-done))
+ (when (ivy-read-action)
+ (ivy-done)))
(defun ivy-dispatching-call ()
"Select one of the available actions and call `ivy-call'."
- [elpa] master 9ffa9c7 121/272: ivy.el (ivy--regex): Don't consider \\(?...\) a group, (continued)
- [elpa] master 9ffa9c7 121/272: ivy.el (ivy--regex): Don't consider \\(?...\) a group, Oleh Krehel, 2016/04/25
- [elpa] master 71bb1c0 144/272: ivy.el (ivy-alt-done): Simplify, Oleh Krehel, 2016/04/25
- [elpa] master e12ff84 125/272: counsel.el (counsel-list-processes-action-switch): Improve, Oleh Krehel, 2016/04/25
- [elpa] master 1737ced 064/272: ivy.el (ivy-inhibit-action): New variable, Oleh Krehel, 2016/04/25
- [elpa] master 05a7b61 070/272: ivy.el (ivy--reset-state): Support a list of symbols as collection, Oleh Krehel, 2016/04/25
- [elpa] master 65ec32c 080/272: README.md: mention the manual more prominently, Oleh Krehel, 2016/04/25
- [elpa] master 4af5c2e 115/272: Add `counsel-locate-cmd-mdfind`, Oleh Krehel, 2016/04/25
- [elpa] master 022e658 090/272: When in prog-mode, "M-n" should wrap input with "\b", Oleh Krehel, 2016/04/25
- [elpa] master 9db8308 103/272: counsel.el: Organize the file with outlines, Oleh Krehel, 2016/04/25
- [elpa] master 1c04fb8 126/272: Add ivy-fixed-height-minibuffer, Oleh Krehel, 2016/04/25
- [elpa] master 7a0b243 130/272: Give ivy-read-read-action enough minibuffer space,
Oleh Krehel <=
- [elpa] master 708ca11 141/272: ivy.el: Fix a few face declarations, Oleh Krehel, 2016/04/25
- [elpa] master f647bca 136/272: Simplify the ivy-format-function interface, Oleh Krehel, 2016/04/25
- [elpa] master c2b330b 091/272: doc/ivy.org: Add @vindex and @kindex automatically, Oleh Krehel, 2016/04/25
- [elpa] master 4c99ec6 107/272: counsel.el: Shuffle functions, Oleh Krehel, 2016/04/25
- [elpa] master 0fd6a75 142/272: Move switch-to-buffer to :display-transformer-fn, Oleh Krehel, 2016/04/25
- [elpa] master f5a21db 157/272: ivy.el: define setq-local and defvar-local unless defined, Oleh Krehel, 2016/04/25
- [elpa] master 71644d9 190/272: ivy.el (ivy-read): Remove code that sets action index to 1, Oleh Krehel, 2016/04/25
- [elpa] master 220fd38 079/272: doc/ivy.org: Improve the markup, Oleh Krehel, 2016/04/25
- [elpa] master 50f3092 169/272: counsel.el (counsel--async-sentinel): Start refactor, Oleh Krehel, 2016/04/25
- [elpa] master 41b8b0d 113/272: ivy.el (ivy-occur): Add a warning, Oleh Krehel, 2016/04/25