diff --git a/zsh-syntax-highlighting.zsh b/zsh-syntax-highlighting.zsh index d4ab80e..a3428a9 100755 --- a/zsh-syntax-highlighting.zsh +++ b/zsh-syntax-highlighting.zsh @@ -137,6 +137,10 @@ _zsh_highlight-string() { # Recolorize the current ZLE buffer. _zsh_highlight-zle-buffer() { + # Avoid doing the same work over and over + [[ ${ZSH_PRIOR_HIGHLIGHTED_BUFFER:-} == $BUFFER ]] && return + ZSH_PRIOR_HIGHLIGHTED_BUFFER=$BUFFER + setopt localoptions extendedglob bareglobqual local colorize=true local start_pos=0