swiper icon indicating copy to clipboard operation
swiper copied to clipboard

ivy--re-filter get wrong

Open yjloong opened this issue 1 year ago • 0 comments

Debugger entered--Lisp error: (wrong-type-argument stringp 2164)
  compare-strings("isearch-thing-at-point" nil nil 2164 nil nil t)
  ivy--case-fold-string=("isearch-thing-at-point" 2164)
  cl--position("isearch-thing-at-point" (2164 2269 2972) 0 nil nil)
  cl-position("isearch-thing-at-point" (2164 2269 2972) :test ivy--case-fold-string=)
  ivy--recompute-index("isearch-thing-at-point" (2164 2269 2972))
  ivy--filter("isearch-thing-at-point" (2164 2269 2972))
  ivy--reset-state(#s(ivy-state :prompt "Swiper: " :collection swiper-isearch-function :predicate nil :require-match t :initial-input "isearch-thing-at-point" :history swiper-history :preselect nil :keymap (keymap (18 . swiper-isearch-C-r) (27 keymap (110 . swiper-isearch-thing-at-point)) (remap keymap (ivy-insert-current . swiper--isearch-insert-current)) keymap (3 keymap (6 . swiper-toggle-face-matching)) (67108919 . swiper-mc) (67108903 . swiper-avy) (12 . swiper-recenter-top-bottom) (27 keymap (113 . swiper-query-replace)) (19 . swiper-C-s)) :update-fn #f(compiled-function () #<bytecode 0x69798f5a8643518>) :sort nil :frame #<frame F2 0x561a3b2635c0> :window #<window 3 on packages.el> :buffer #<buffer packages.el> :text nil :action (1 ("o" swiper-isearch-action "default") ("w" swiper-isearch-action-copy "copy") ("i" swiper-isearch-action-insert "insert")) :unwind swiper--isearch-unwind :re-builder swiper--re-builder :matcher nil :dynamic-collection t :display-transformer-fn nil :directory "/home/yjl00405/.emacs.d/lisp/" :caller swiper-isearch :current nil :def nil :ignore t :multi-action nil :extra-props (:fname "/home/yjl00405/.emacs.d/lisp/packages.el")))
  ivy-read("Swiper: " swiper-isearch-function :initial-input "isearch-thing-at-point" :keymap (keymap (18 . swiper-isearch-C-r) (27 keymap (110 . swiper-isearch-thing-at-point)) (remap keymap (ivy-insert-current . swiper--isearch-insert-current)) keymap (3 keymap (6 . swiper-toggle-face-matching)) (67108919 . swiper-mc) (67108903 . swiper-avy) (12 . swiper-recenter-top-bottom) (27 keymap (113 . swiper-query-replace)) (19 . swiper-C-s)) :dynamic-collection t :require-match t :action swiper-isearch-action :re-builder swiper--re-builder :history swiper-history :extra-props (:fname "/home/yjl00405/.emacs.d/lisp/packages.el") :caller swiper-isearch)
  swiper-isearch("isearch-thing-at-point")

After the commit 738da36d1b61e5b2a38e5775b23edd214ad88d6e, a bug run well before has been fixed in it. In my env, function ivy--re-filter's args re a string, and candidates a list(number). They will be called with string-match-p. But they are string and number. So error will ignored with ignore-errors function. Just like nothing has been filtered. But the fix has not considered string-match-p. Maybe the question is only caused by my env's setting.

yjloong avatar May 24 '24 01:05 yjloong