highlight query on top of zsh-syntax-highlighting

This commit is contained in:
Suraj N. Kurapati 2011-05-26 08:58:56 -07:00
parent 1e02a2118e
commit 7b71437106

View file

@ -79,6 +79,9 @@ history-substring-search-begin() {
} }
history-substring-search-highlight() { history-substring-search-highlight() {
# clear previously applied search query highlighting
region_highlight=()
# highlight $BUFFER using zsh-syntax-highlighting plugin # highlight $BUFFER using zsh-syntax-highlighting plugin
# https://github.com/nicoulaj/zsh-syntax-highlighting # https://github.com/nicoulaj/zsh-syntax-highlighting
if [[ $+functions[_zsh_highlight-zle-buffer] -eq 1 ]]; then if [[ $+functions[_zsh_highlight-zle-buffer] -eq 1 ]]; then
@ -93,7 +96,7 @@ history-substring-search-highlight() {
: ${(S)BUFFER##(#m)($history_substring_search_query##)} : ${(S)BUFFER##(#m)($history_substring_search_query##)}
let "history_substring_search_query_mbegin = $MEND - $#history_substring_search_query" let "history_substring_search_query_mbegin = $MEND - $#history_substring_search_query"
# this is slightly more informative than highlighting that fish performs # this is slightly more informative than highlighting that fish performs
region_highlight=("$history_substring_search_query_mbegin $MEND $1") region_highlight+=("$history_substring_search_query_mbegin $MEND $1")
fi fi
} }