Fix how project search escapes spaces #1487
When invoking project search (via SPC / p) with an active selection.
This commit is contained in:
parent
c9305a552d
commit
6f3c1c6d00
1 changed files with 7 additions and 2 deletions
|
@ -339,8 +339,13 @@ order.
|
||||||
(end (or (bound-and-true-p evil-visual-end) (region-end))))
|
(end (or (bound-and-true-p evil-visual-end) (region-end))))
|
||||||
(when (> (abs (- end beg)) 1)
|
(when (> (abs (- end beg)) 1)
|
||||||
(let ((query (buffer-substring-no-properties beg end)))
|
(let ((query (buffer-substring-no-properties beg end)))
|
||||||
(replace-regexp-in-string "!" "\\!" (regexp-quote query)
|
;; Escape characters that are special to ivy searches
|
||||||
nil t)))))))
|
(replace-regexp-in-string "[! ]" (lambda (substr)
|
||||||
|
(if (and (featurep! +fuzzy)
|
||||||
|
(string= substr " "))
|
||||||
|
" "
|
||||||
|
(concat "\\\\" substr)))
|
||||||
|
(regexp-quote query))))))))
|
||||||
(prompt
|
(prompt
|
||||||
(format "%s%%s %s"
|
(format "%s%%s %s"
|
||||||
(symbol-name engine)
|
(symbol-name engine)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue