mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-12-04 21:56:45 +01:00
Stop leaking variables into global namespace.
Set WARN_CREATE_GLOBAL to prevent recurrence. Fixes zsh-users/zsh-syntax-highlighting#192.
This commit is contained in:
parent
1467eae86d
commit
908c4fe150
2 changed files with 4 additions and 3 deletions
|
|
@ -45,7 +45,7 @@ _zsh_highlight()
|
|||
# Store the previous command return code to restore it whatever happens.
|
||||
local ret=$?
|
||||
|
||||
setopt localoptions nowarncreateglobal
|
||||
setopt localoptions warncreateglobal
|
||||
|
||||
# Do not highlight if there are more than 300 chars in the buffer. It's most
|
||||
# likely a pasted command or a huge list of files in that case..
|
||||
|
|
@ -125,8 +125,8 @@ _zsh_highlight()
|
|||
|
||||
|
||||
} always {
|
||||
_ZSH_HIGHLIGHT_PRIOR_BUFFER=$BUFFER
|
||||
_ZSH_HIGHLIGHT_PRIOR_CURSOR=$CURSOR
|
||||
typeset -g _ZSH_HIGHLIGHT_PRIOR_BUFFER=$BUFFER
|
||||
typeset -gi _ZSH_HIGHLIGHT_PRIOR_CURSOR=$CURSOR
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue