mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-12-04 21:56:45 +01:00
Preserve $? of wrapped widgets.
This commit is contained in:
parent
eaffd88793
commit
f78919d941
1 changed files with 2 additions and 2 deletions
|
|
@ -42,11 +42,11 @@ typeset -ga ZSH_HIGHLIGHT_HIGHLIGHTERS
|
|||
# This function is supposed to be called whenever the ZLE state changes.
|
||||
_zsh_highlight()
|
||||
{
|
||||
setopt localoptions nowarncreateglobal
|
||||
|
||||
# Store the previous command return code to restore it whatever happens.
|
||||
local ret=$?
|
||||
|
||||
setopt localoptions nowarncreateglobal
|
||||
|
||||
# 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..
|
||||
[[ -n ${ZSH_HIGHLIGHT_MAXLENGTH:-} ]] && [[ $#BUFFER -gt $ZSH_HIGHLIGHT_MAXLENGTH ]] && return $ret
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue