diff options
| author | tumashu <tumashu@163.com> | 2021-04-27 05:44:51 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-27 05:44:51 +0800 |
| commit | 084cc59ea2cd62afaa51445ada3d00404749a541 (patch) | |
| tree | f3b1ad5ff3928ab27899b4623c3b622e248bbf57 | |
| parent | 7f1ab7890040c4b8dc4e9645c824cd35210e1121 (diff) | |
| parent | 081636a554a3715f6772e15d15f6e182d0f53eba (diff) | |
Merge pull request #111 from tttuuu888/work-dispatching-call
Add ivy-posframe-dispatching-call and ivy-posframe--dispatching-call
| -rw-r--r-- | ivy-posframe.el | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/ivy-posframe.el b/ivy-posframe.el index 464be6f..723141f 100644 --- a/ivy-posframe.el +++ b/ivy-posframe.el @@ -375,6 +375,25 @@ This variable is useful for `ivy-posframe-read-action' .") (let ((ivy-read-action-function #'ivy-posframe-read-action-by-key)) (ivy-posframe--dispatching-done))) +(defun ivy-posframe--dispatching-call () + "Select one of the available actions and call `ivy-call'." + (interactive) + (setq ivy-current-prefix-arg current-prefix-arg) + (let ((actions (copy-sequence (ivy-state-action ivy-last))) + (old-ivy-text ivy-text)) + (unwind-protect + (when (ivy-read-action) + (ivy-set-text old-ivy-text) + (ivy-call)) + (ivy-set-action actions))) + (ivy-posframe-shrink-after-dispatching)) + +(defun ivy-posframe-dispatching-call () + "Ivy-posframe's `ivy-dispatching-call'." + (interactive) + (let ((ivy-read-action-function #'ivy-posframe-read-action-by-key)) + (ivy-posframe--dispatching-call))) + (defun ivy-posframe-read-action () "Ivy-posframe version `ivy-read-action'" (interactive) @@ -632,7 +651,8 @@ This variable is useful for `ivy-posframe-read-action' .") :keymap '(([remap ivy-avy] . ivy-posframe-avy) ([remap swiper-avy] . ivy-posframe-swiper-avy) ([remap ivy-read-action] . ivy-posframe-read-action) - ([remap ivy-dispatching-done] . ivy-posframe-dispatching-done)) + ([remap ivy-dispatching-done] . ivy-posframe-dispatching-done) + ([remap ivy-dispatching-call] . ivy-posframe-dispatching-call)) (if ivy-posframe-mode (mapc (lambda (elm) (advice-add (car elm) :around (cdr elm))) |
