make highlighting work for first entry in history. fixes #79

This commit is contained in:
Andreas Gahr 2011-09-27 16:08:23 +02:00
parent f824e5e84d
commit 304ddb9400

View file

@ -203,5 +203,12 @@ _zsh_highlight_load_highlighters "${ZSH_HIGHLIGHT_HIGHLIGHTERS_DIR:-${0:h}/highl
return 1
}
# Reset scratch variables when commandline is done.
_zsh_highlight_preexec_hook()
{
_ZSH_HIGHLIGHT_PRIOR_BUFFER=
}
add-zsh-hook preexec _zsh_highlight_preexec_hook
# Initialize the array of active highlighters if needed.
[[ $#ZSH_HIGHLIGHT_HIGHLIGHTERS -eq 0 ]] && ZSH_HIGHLIGHT_HIGHLIGHTERS=(main) || true