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.
This commit is contained in:
Mark Triggs 2016-05-15 15:15:51 +10:00
parent 2e3c2f7c88
commit 58bc417c55

4
avy.el
View File

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