From 527f95fee93610a73ac63f4916bf8e1cfe35fefe Mon Sep 17 00:00:00 2001 From: "Suraj N. Kurapati" Date: Tue, 13 Mar 2012 10:32:59 -0700 Subject: [PATCH] GH-9: retain search query highlight on cursor move --- zsh-history-substring-search.zsh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/zsh-history-substring-search.zsh b/zsh-history-substring-search.zsh index 9468a3b..3867656 100644 --- a/zsh-history-substring-search.zsh +++ b/zsh-history-substring-search.zsh @@ -89,11 +89,14 @@ zmodload -F zsh/parameter # if [[ $+functions[_zsh_highlight] -eq 0 ]]; then # - # Dummy implementation of _zsh_highlight() - # that simply removes existing highlights + # Dummy implementation of _zsh_highlight() that + # simply removes any existing highlights when the + # user inserts printable characters into $BUFFER. # function _zsh_highlight() { - region_highlight=() + if [[ $KEYS == [[:print:]] ]]; then + region_highlight=() + fi } #