mirror of
https://github.com/doomemacs/doomemacs
synced 2025-08-01 12:17:25 -05:00
Fix how project search escapes regexps #1486
When invoking project search (via SPC / p) with an active selection, the selection is captured and escaped, but was escaped incorrectly.
This commit is contained in:
@ -333,12 +333,14 @@ order.
|
|||||||
'grep)
|
'grep)
|
||||||
(error "No search engine specified (is ag, rg, pt or git installed?)")))
|
(error "No search engine specified (is ag, rg, pt or git installed?)")))
|
||||||
(query
|
(query
|
||||||
(or (if query (rxt-quote-pcre query))
|
(or (if query query)
|
||||||
(when (use-region-p)
|
(when (use-region-p)
|
||||||
(let ((beg (or (bound-and-true-p evil-visual-beginning) (region-beginning)))
|
(let ((beg (or (bound-and-true-p evil-visual-beginning) (region-beginning)))
|
||||||
(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)
|
||||||
(rxt-quote-pcre (buffer-substring-no-properties beg end)))))))
|
(let ((query (buffer-substring-no-properties beg end)))
|
||||||
|
(replace-regexp-in-string "!" "\\!" (regexp-quote query)
|
||||||
|
nil t)))))))
|
||||||
(prompt
|
(prompt
|
||||||
(format "%s%%s %s"
|
(format "%s%%s %s"
|
||||||
(symbol-name engine)
|
(symbol-name engine)
|
||||||
|
Reference in New Issue
Block a user