Avoid processing the same buffer multiple times.

This commit is contained in:
Wayne Davison 2010-12-31 15:16:34 -08:00
parent ce15291cfb
commit a4e7eddae7

View File

@ -137,6 +137,10 @@ _zsh_highlight-string() {
# Recolorize the current ZLE buffer. # Recolorize the current ZLE buffer.
_zsh_highlight-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 setopt localoptions extendedglob bareglobqual
local colorize=true local colorize=true
local start_pos=0 local start_pos=0