[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 704b1de 328/399: ivy.el (ivy-avy): Allow to scroll with "C
From: |
Oleh Krehel |
Subject: |
[elpa] master 704b1de 328/399: ivy.el (ivy-avy): Allow to scroll with "C-v" and "M-v" |
Date: |
Sat, 20 Jul 2019 14:57:50 -0400 (EDT) |
branch: master
commit 704b1de38ce202ecec307f244ff46d071bbe02ee
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el (ivy-avy): Allow to scroll with "C-v" and "M-v"
Fixes abo-abo/avy#276
---
ivy.el | 26 +++++++++++++++++++++++---
1 file changed, 23 insertions(+), 3 deletions(-)
diff --git a/ivy.el b/ivy.el
index 2ab556d..24797c2 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1629,6 +1629,23 @@ This string is inserted into the minibuffer.")
(substring-no-properties
(nth (+ (car bnd) (- (line-number-at-pos pt) 2)) ivy--old-cands))))))
+(defun ivy--avy-handler-function (char)
+ (let (cmd)
+ (cond ((memq char '(27 ?\C-g))
+ ;; exit silently
+ (throw 'done 'abort))
+ ((memq (setq cmd (lookup-key ivy-minibuffer-map (vector char)))
+ '(ivy-scroll-up-command
+ ivy-scroll-down-command))
+ (funcall cmd)
+ (ivy--exhibit)
+ (throw 'done 'exit))
+ ;; ignore wrong key
+ (t
+ (throw 'done 'restart)))))
+
+(defvar avy-handler-function)
+
(defun ivy-avy ()
"Jump to one of the current ivy candidates."
(interactive)
@@ -1639,9 +1656,12 @@ This string is inserted into the minibuffer.")
avy-keys))
(avy-style (or (cdr (assq 'ivy-avy avy-styles-alist))
avy-style))
- (avy-action #'ivy--avy-action))
- (avy-process
- (ivy--avy-candidates))))
+ (avy-action #'identity)
+ (avy-handler-function #'ivy--avy-handler-function)
+ res)
+ (while (eq (setq res (avy-process (ivy--avy-candidates))) t))
+ (when res
+ (ivy--avy-action res))))
(defun ivy-sort-file-function-default (x y)
"Compare two files X and Y.
- [elpa] master 676a8ee 318/399: swiper.el (swiper-isearch-current-match): Remove unused face, (continued)
- [elpa] master 676a8ee 318/399: swiper.el (swiper-isearch-current-match): Remove unused face, Oleh Krehel, 2019/07/20
- [elpa] master ba626e7 317/399: ivy.el (ivy-next-history-element): Use minibuffer-default for dired-dwim-target, Oleh Krehel, 2019/07/20
- [elpa] master 51e765e 316/399: ivy.el (ivy-partial): Return nil when comletion was not updated, Oleh Krehel, 2019/07/20
- [elpa] master 16d2268 320/399: Fix ivy-push/switch-view windows layout, Oleh Krehel, 2019/07/20
- [elpa] master d260c48 322/399: swiper.el: Obey search-invisible, Oleh Krehel, 2019/07/20
- [elpa] master de8842e 323/399: Add ivy-switch-buffer-map to counsel-switch-buffer, Oleh Krehel, 2019/07/20
- [elpa] master 0d87297 326/399: counsel.el (counsel-open-buffer-file-externally): Cleanup, Oleh Krehel, 2019/07/20
- [elpa] master 7defba2 327/399: ivy.el (ivy-avy): Fix when there's a scroll, Oleh Krehel, 2019/07/20
- [elpa] master 07c65b3 325/399: ivy.el (ivy--set-index-dynamic-collection): Extract, Oleh Krehel, 2019/07/20
- [elpa] master 400d56f 319/399: counsel.el (counsel-open-buffer-file-externally): New function, Oleh Krehel, 2019/07/20
- [elpa] master 704b1de 328/399: ivy.el (ivy-avy): Allow to scroll with "C-v" and "M-v",
Oleh Krehel <=
- [elpa] master 7183491 332/399: ivy.el (ivy--minibuffer-setup): Avoid extra call to ivy--exhibit, Oleh Krehel, 2019/07/20
- [elpa] master a249d15 329/399: ivy-test.el (ivy-avy): Only run if avy is installed, Oleh Krehel, 2019/07/20
- [elpa] master 15f8e10 330/399: .travis.yml: Add emacs-25.3 and emacs-26.2, Oleh Krehel, 2019/07/20
- [elpa] master d752db5 333/399: counsel.el (counsel-find-file-extern-extensions): New defcustom, Oleh Krehel, 2019/07/20
- [elpa] master cfb8d49 335/399: counsel.el (counsel-find-file-ignore-regexp): Add lockfiles to dotfiles, Oleh Krehel, 2019/07/20
- [elpa] master 011626a 343/399: ivy.el (ivy-occur-press): Improve when window config changed, Oleh Krehel, 2019/07/20
- [elpa] master 8db9cc1 349/399: swiper.el (swiper--add-cursor-overlay): Avoid a very wide cursor on tab chars, Oleh Krehel, 2019/07/20
- [elpa] master 40d8114 338/399: counsel.el (counsel-shell-command-history): Remove obsolete command, Oleh Krehel, 2019/07/20
- [elpa] master f0a2341 337/399: counsel.el (counsel-rhythmbox): Add :require-match, Oleh Krehel, 2019/07/20
- [elpa] master 4de54f1 340/399: ivy.el (ivy-reverse-i-search-kill): Add and bind to "C-k", Oleh Krehel, 2019/07/20