From 5f68accccfd2e7cf2b7c4563b0ceb51a68f97868 Mon Sep 17 00:00:00 2001 From: Valodim Date: Mon, 25 Jul 2011 14:50:26 +0200 Subject: [PATCH] Don't highlight if buffer is longer than $ZSH_HIGHLIGHT_MAXLENGTH --- zsh-syntax-highlighting.zsh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zsh-syntax-highlighting.zsh b/zsh-syntax-highlighting.zsh index 3f72ff2..674aaf2 100644 --- a/zsh-syntax-highlighting.zsh +++ b/zsh-syntax-highlighting.zsh @@ -47,6 +47,10 @@ _zsh_highlight() # Store the previous command return code to restore it whatever happens. local ret=$? + # 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 + # Do not highlight if there are pending inputs (copy/paste). [[ $PENDING -gt 0 ]] && return $ret