aboutsummaryrefslogtreecommitdiff
path: root/evil-search.el
diff options
context:
space:
mode:
authorFrank Fischer <frank-fischer@shadow-soft.de>2015-11-09 17:29:20 +0100
committerFrank Fischer <frank-fischer@shadow-soft.de>2015-11-09 17:29:20 +0100
commit5665e1508467e8b9eb32ac469c55a4b7642283b1 (patch)
tree5674cc879cd73ba2e1d59aae3e956d9d14747699 /evil-search.el
parent2406f46b9e687e3003ca32e360d0f114afb137ff (diff)
search: show default search string in shadow face (fix #591)
Diffstat (limited to 'evil-search.el')
-rw-r--r--evil-search.el16
1 files changed, 13 insertions, 3 deletions
diff --git a/evil-search.el b/evil-search.el
index da3f18b..4095de6 100644
--- a/evil-search.el
+++ b/evil-search.el
@@ -1045,6 +1045,10 @@ current search result."
(goto-char (+ beg count))
(setq evil-this-type 'inclusive))))))))
+(defun evil-ex-search-setup ()
+ "Hook to initialize the minibuffer for ex search."
+ (add-hook 'pre-command-hook #'evil-ex-remove-default))
+
(defun evil-ex-start-search (direction count)
"Start a new search in a certain DIRECTION."
;; store buffer and window where the search started
@@ -1060,9 +1064,15 @@ current search result."
(let* ((minibuffer-local-map evil-ex-search-keymap)
(search-string
(condition-case err
- (read-string (if (eq evil-ex-search-direction 'forward)
- "/" "?")
- nil 'evil-ex-search-history)
+ (minibuffer-with-setup-hook
+ #'evil-ex-search-setup
+ (read-string (if (eq evil-ex-search-direction 'forward)
+ "/" "?")
+ (and evil-ex-search-history
+ (propertize
+ (car evil-ex-search-history)
+ 'face 'shadow))
+ 'evil-ex-search-history))
(quit
(evil-ex-search-stop-session)
(evil-ex-delete-hl 'evil-ex-search)