mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-12-04 21:56:45 +01:00
Avoid processing the same buffer multiple times.
This commit is contained in:
parent
ce15291cfb
commit
a4e7eddae7
1 changed files with 4 additions and 0 deletions
|
|
@ -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
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue