From cdfef48b64761eb01489a438fa5e01cbccd35a72 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Mon, 16 Dec 2019 17:46:47 -0500 Subject: [PATCH] completion/ivy: fix +fuzzy --- modules/completion/ivy/config.el | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/modules/completion/ivy/config.el b/modules/completion/ivy/config.el index 1d2777d0e..5c9e85652 100644 --- a/modules/completion/ivy/config.el +++ b/modules/completion/ivy/config.el @@ -18,13 +18,16 @@ results buffer.") (if (featurep! +prescient) #'+ivy-prescient-non-fuzzy #'ivy--regex-plus) - "Function to use for non-fuzzy search commands.") + "Function to use for non-fuzzy search commands. +This uses the standard search algorithm ivy uses (or a variant of it).") (defvar +ivy-alternative-search-fn (cond ((featurep! +prescient) #'ivy-prescient-re-builder) ((featurep! +fuzzy) #'ivy--regex-fuzzy) + ;; Ignore order for non-fuzzy searches by default (#'ivy--regex-ignore-order)) - "Function to use for fuzzy search commands.") + "Function to use for fuzzy search commands. +This uses a search algorithm other than ivy's default.") ;; @@ -34,12 +37,10 @@ results buffer.") :after-call pre-command-hook :init (setq ivy-re-builders-alist - `(,@(cl-loop for cmd in '(counsel-rg - swiper - swiper-isearch) - collect (cons cmd #'+ivy-alternative-search)) - ;; Ignore order for non-fuzzy searches by default - (t . +ivy-standard-search))) + `((counsel-rg . +ivy-standard-search) + (swiper . +ivy-standard-search) + (swiper-isearch . +ivy-standard-search) + (t . +ivy-alternative-search))) (define-key! [remap switch-to-buffer] #'+ivy/switch-buffer