[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] master 589e03f 144/184: ivy.el (ivy-configure): Use for ivy-index
From: |
Oleh Krehel |
Subject: |
[elpa] master 589e03f 144/184: ivy.el (ivy-configure): Use for ivy-index-functions-alist |
Date: |
Wed, 16 Oct 2019 13:15:10 -0400 (EDT) |
branch: master
commit 589e03f02b9f84108d42486ee9a83065c1255419
Author: Oleh Krehel <address@hidden>
Commit: Oleh Krehel <address@hidden>
ivy.el (ivy-configure): Use for ivy-index-functions-alist
---
counsel.el | 7 ++++---
ivy.el | 9 ++++-----
swiper.el | 6 ++++--
3 files changed, 12 insertions(+), 10 deletions(-)
diff --git a/counsel.el b/counsel.el
index 2286d9c..713166b 100644
--- a/counsel.el
+++ b/counsel.el
@@ -1520,7 +1520,8 @@ When CMD is non-nil, prompt for a specific \"git grep\"
command."
(ivy-configure 'counsel-git-grep
:occur #'counsel-git-grep-occur
- :unwind-fn #'counsel--grep-unwind)
+ :unwind-fn #'counsel--grep-unwind
+ :index-fn #'ivy-recompute-index-swiper-async)
(cl-pushnew 'counsel-git-grep ivy-highlight-grep-commands)
@@ -3085,7 +3086,7 @@ When non-nil, INITIAL-INPUT is the initial search
pattern."
(init-point (point))
res)
(unwind-protect
- (setq res (ivy-read "grep: " 'counsel-grep-function
+ (setq res (ivy-read "grep: " #'counsel-grep-function
:initial-input initial-input
:dynamic-collection t
:preselect
@@ -3096,7 +3097,6 @@ When non-nil, INITIAL-INPUT is the initial search
pattern."
(buffer-substring-no-properties
(line-beginning-position)
(line-end-position)))))
-
:keymap counsel-grep-map
:history 'counsel-grep-history
:re-builder #'ivy--regex
@@ -3108,6 +3108,7 @@ When non-nil, INITIAL-INPUT is the initial search
pattern."
(ivy-configure 'counsel-grep
:update-fn 'auto
:unwind-fn #'counsel--grep-unwind
+ :index-fn #'ivy-recompute-index-swiper-async
:occur #'counsel-grep-occur
:more-chars 2)
diff --git a/ivy.el b/ivy.el
index cc93077..c8ac5f1 100644
--- a/ivy.el
+++ b/ivy.el
@@ -1829,11 +1829,7 @@ specified for the current collection in
(ivy--reset-state ivy-last))))
(defvar ivy-index-functions-alist
- '((swiper . ivy-recompute-index-swiper)
- (swiper-multi . ivy-recompute-index-swiper)
- (counsel-git-grep . ivy-recompute-index-swiper)
- (counsel-grep . ivy-recompute-index-swiper-async)
- (t . ivy-recompute-index-zero))
+ '((t . ivy-recompute-index-zero))
"An alist of index recomputing functions for each collection function.
When the input changes, the appropriate function returns an
integer - the index of the matched candidate that should be
@@ -1921,6 +1917,7 @@ May supersede `ivy-initial-inputs-alist'."
occur
update-fn
unwind-fn
+ index-fn
more-chars)
"Configure `ivy-read' params for CALLER."
(declare (indent 1))
@@ -1932,6 +1929,8 @@ May supersede `ivy-initial-inputs-alist'."
(ivy--alist-set 'ivy-update-fns-alist caller update-fn))
(when unwind-fn
(ivy--alist-set 'ivy-unwind-fns-alist caller unwind-fn))
+ (when index-fn
+ (ivy--alist-set 'ivy-index-functions-alist caller index-fn))
(when more-chars
(ivy--alist-set 'ivy-more-chars-alist caller more-chars)))
diff --git a/swiper.el b/swiper.el
index 6af5a25..289a0f7 100644
--- a/swiper.el
+++ b/swiper.el
@@ -809,7 +809,8 @@ When non-nil, INITIAL-INPUT is the initial search pattern."
(ivy-configure 'swiper
:occur #'swiper-occur
:update-fn #'swiper--update-input-ivy
- :unwind-fn #'swiper--cleanup)
+ :unwind-fn #'swiper--cleanup
+ :index-fn #'ivy-recompute-index-swiper)
(defun swiper-toggle-face-matching ()
"Toggle matching only the candidates with `swiper-invocation-face'."
@@ -1133,7 +1134,8 @@ Run `swiper' for those buffers."
:caller 'swiper-multi)))
(ivy-configure 'swiper-multi
- :unwind-fn #'swiper--cleanup)
+ :unwind-fn #'swiper--cleanup
+ :index-fn #'ivy-recompute-index-swiper)
(defun swiper-multi-action-1 (x)
"Add X to list of selected buffers `swiper-multi-buffers'.
- [elpa] master bfe4454 021/184: Fix swiper--isearch-filter-ignore-order return value, (continued)
- [elpa] master bfe4454 021/184: Fix swiper--isearch-filter-ignore-order return value, Oleh Krehel, 2019/10/16
- [elpa] master bb65c4e 039/184: swiper.el (swiper--current-window-start): Refactor, Oleh Krehel, 2019/10/16
- [elpa] master 76fff20 114/184: counsel-M-x: Propertize names of active modes., Oleh Krehel, 2019/10/16
- [elpa] master bfdda68 111/184: swiper.el (swiper-occur): Use ivy-occur-next-error, Oleh Krehel, 2019/10/16
- [elpa] master 84e1ab8 117/184: counsel.el (counsel-package): Refresh contents automatically, Oleh Krehel, 2019/10/16
- [elpa] master 9d3d7de 132/184: counsel.el (counsel-slime-repl-history): Add., Oleh Krehel, 2019/10/16
- [elpa] master 9e1b9a0 131/184: counsel.el (counsel-google-function): Add missing require, Oleh Krehel, 2019/10/16
- [elpa] master 5ff8b5e 133/184: ivy.el (ivy-completion-in-region-action): Use declare-function., Oleh Krehel, 2019/10/16
- [elpa] master 78dd554 134/184: ivy.el (ivy--exhibit): Handle ivy--reset-state initial call, Oleh Krehel, 2019/10/16
- [elpa] master c1ea2af 145/184: ivy.el (ivy-read): Fix conflict an existing read-key session, Oleh Krehel, 2019/10/16
- [elpa] master 589e03f 144/184: ivy.el (ivy-configure): Use for ivy-index-functions-alist,
Oleh Krehel <=
- [elpa] master 64c0804 163/184: ivy.el (ivy-partial-or-done): Work with completion-cycle-threshold, Oleh Krehel, 2019/10/16
- [elpa] master 6f23c5e 152/184: ivy.el (ivy-occur-press): Re-use ivy-highlight-grep-commands, Oleh Krehel, 2019/10/16
- [elpa] master f46cdad 154/184: counsel.el (counsel-grep): Add :require-match, Oleh Krehel, 2019/10/16
- [elpa] master 2d840b8 157/184: ivy.el (ivy-configure): Add :sort-fn, Oleh Krehel, 2019/10/16
- [elpa] master f0451db 173/184: ivy.el (ivy-occur-revert-buffer): Don't error if the swiper buffer was killed, Oleh Krehel, 2019/10/16
- [elpa] master 3bd1d87 182/184: counsel.el (counsel-locate-cmd-es): Encode command to local codepage, Oleh Krehel, 2019/10/16
- [elpa] master 8b4693c 169/184: counsel.el (counsel-imenu-action and -get-canditates-from): Revert., Oleh Krehel, 2019/10/16
- [elpa] master 882d6c4 161/184: counsel.el (counsel-imenu): Work with :update-fn 'auto, Oleh Krehel, 2019/10/16
- [elpa] master 1a9002b 168/184: ivy.el: Clean up obsolete aliases, Oleh Krehel, 2019/10/16
- [elpa] master c2d3a4c 184/184: Merge commit 'cd634c6f51458f81898ecf2821ac3169cb65a1eb' from ivy, Oleh Krehel, 2019/10/16