Escape regex metacharacters for standard isearch

Doing an isearch for '[' and then invoking avy-isearch would trigger an
error like:

     Invalid regexp: "Unmatched [ or [^"

If we are not doing a regex-based search, escape the search string to
avoid these kind of issues.
master
Mark Triggs 10 years ago
parent 2e3c2f7c88
commit 58bc417c55
  1. 4
      avy.el

@ -982,7 +982,9 @@ The window scope is determined by `avy-all-windows' (ARG negates it)."
(avy-with avy-isearch (avy-with avy-isearch
(let ((avy-background nil)) (let ((avy-background nil))
(avy--process (avy--process
(avy--regex-candidates isearch-string) (avy--regex-candidates (if isearch-regexp
isearch-string
(regexp-quote isearch-string)))
(avy--style-fn avy-style)) (avy--style-fn avy-style))
(isearch-done)))) (isearch-done))))

Loading…
Cancel
Save