From f78919d941d3418681622e74731d76b1e944d2a1 Mon Sep 17 00:00:00 2001 From: Daniel Shahaf Date: Sat, 5 Sep 2015 21:44:11 +0000 Subject: [PATCH] Preserve $? of wrapped widgets. --- zsh-syntax-highlighting.zsh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/zsh-syntax-highlighting.zsh b/zsh-syntax-highlighting.zsh index e418187..ef62139 100644 --- a/zsh-syntax-highlighting.zsh +++ b/zsh-syntax-highlighting.zsh @@ -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