emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/swiper f6b46bc 1/3: Fix swiper-avy error with swiper-is


From: Basil L. Contovounesios
Subject: [elpa] externals/swiper f6b46bc 1/3: Fix swiper-avy error with swiper-isearch (#2873)
Date: Fri, 21 May 2021 09:22:23 -0400 (EDT)

branch: externals/swiper
commit f6b46bc571dc4f62eee657b4d2ccb482ff65c240
Author: Basil L. Contovounesios <contovob@tcd.ie>
Commit: Basil L. Contovounesios <contovob@tcd.ie>

    Fix swiper-avy error with swiper-isearch (#2873)
    
    * swiper.el (swiper-avy): Don't call swiper--update-input-ivy for
    swiper-isearch, as the former expects string candidates and the
    latter now uses buffer positions.
    
    Closes #2867.
---
 swiper.el | 11 +++++++----
 1 file changed, 7 insertions(+), 4 deletions(-)

diff --git a/swiper.el b/swiper.el
index 7e4f7ed..ed8192d 100644
--- a/swiper.el
+++ b/swiper.el
@@ -355,16 +355,19 @@ If the input is empty, select the previous history 
element instead."
 
 ;;;###autoload
 (defun swiper-avy ()
-  "Jump to one of the current swiper candidates."
+  "Jump to one of the current swiper candidates with `avy'."
   (interactive)
   (unless (require 'avy nil 'noerror)
-    (error "Package avy isn't installed"))
+    (user-error "Package avy isn't installed"))
   (cl-case (length ivy-text)
     (0
      (user-error "Need at least one char of input"))
     (1
-     (let ((swiper-min-highlight 1))
-       (swiper--update-input-ivy))))
+     ;; FIXME: `swiper--update-input-ivy' expects string candidates,
+     ;; but `swiper-isearch' now uses buffer positions.
+     (when (stringp (ivy-state-current ivy-last))
+       (let ((swiper-min-highlight 1))
+         (swiper--update-input-ivy)))))
   (swiper--avy-goto (swiper--avy-candidate)))
 
 (declare-function mc/create-fake-cursor-at-point "ext:multiple-cursors-core")



reply via email to

[Prev in Thread] Current Thread [Next in Thread]