From 4d0c5604d9beaa568b34176b291b86b328fda1fa Mon Sep 17 00:00:00 2001 From: Paul Ackersviller Date: Wed, 12 Oct 2016 23:34:29 -0400 Subject: [PATCH] nother error trap to prevent --- highlighters/main/main-highlighter.zsh | 4 ++-- zsh-syntax-highlighting.zsh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/highlighters/main/main-highlighter.zsh b/highlighters/main/main-highlighter.zsh index a491bb8..39b1145 100644 --- a/highlighters/main/main-highlighter.zsh +++ b/highlighters/main/main-highlighter.zsh @@ -146,8 +146,8 @@ _zsh_highlight_main__type() { REPLY=none fi fi - if ! (( $+REPLY )); then - REPLY="${$(LC_ALL=C builtin type -w -- $1 2>/dev/null)#*: }" + if ! (( $+REPLY )); then # below will frequently trigger ERR trap without || : + REPLY="${$(LC_ALL=C builtin type -w -- $1 2>/dev/null || :)#*: }" fi if (( $+_zsh_highlight_main__command_type_cache )); then _zsh_highlight_main__command_type_cache[(e)$1]=$REPLY diff --git a/zsh-syntax-highlighting.zsh b/zsh-syntax-highlighting.zsh index 0c74cb8..096b4c7 100644 --- a/zsh-syntax-highlighting.zsh +++ b/zsh-syntax-highlighting.zsh @@ -66,7 +66,7 @@ _zsh_highlight() fi # Did a couple of tweaks to highlighters/main/main-highlighter.zsh -# to prevent need for following, thut there'll surely be others. +# to prevent need for following, though there'll surely be others. # setopt localtraps # unfunction TRAPZERR setopt localoptions noksharrays warncreateglobal @@ -337,7 +337,7 @@ _zsh_highlight_load_highlighters() for highlighter_dir ($1/*/); do highlighter="${highlighter_dir:t}" [[ -f "$highlighter_dir/${highlighter}-highlighter.zsh" ]] && - . "$highlighter_dir/${highlighter}-highlighter.zsh" + source "$highlighter_dir/${highlighter}-highlighter.zsh" if type "_zsh_highlight_highlighter_${highlighter}_paint" &> /dev/null && type "_zsh_highlight_highlighter_${highlighter}_predicate" &> /dev/null; then