From 35f701a99916a9e6f7d35960cba5515373953d75 Mon Sep 17 00:00:00 2001 From: Henrik Lissner Date: Tue, 14 Sep 2021 19:51:09 +0200 Subject: [PATCH] fix(default): search region literally in +default/search-buffer --- modules/config/default/autoload/search.el | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/modules/config/default/autoload/search.el b/modules/config/default/autoload/search.el index 2077c47a6..66ecb9758 100644 --- a/modules/config/default/autoload/search.el +++ b/modules/config/default/autoload/search.el @@ -26,7 +26,8 @@ If prefix ARG is set, prompt for a directory to search from." "Conduct a text search on the current buffer. If a selection is active, pre-fill the prompt with it." (interactive) - (cond ((or (featurep! :completion helm) (featurep! :completion ivy)) + (cond ((or (featurep! :completion helm) + (featurep! :completion ivy)) (call-interactively (if (region-active-p) #'swiper-isearch-thing-at-point @@ -36,7 +37,11 @@ If a selection is active, pre-fill the prompt with it." (let ((start (region-beginning)) (end (region-end))) (deactivate-mark) - (consult-line (buffer-substring-no-properties start end))) + (consult-line + (replace-regexp-in-string + " " "\\\\ " + (rxt-quote-pcre + (buffer-substring-no-properties start end))))) (call-interactively #'consult-line))))) ;;;###autoload