diff --git a/highlighters/main/main-highlighter.zsh b/highlighters/main/main-highlighter.zsh index f7aa2a9..a491bb8 100644 --- a/highlighters/main/main-highlighter.zsh +++ b/highlighters/main/main-highlighter.zsh @@ -95,7 +95,7 @@ _zsh_highlight_main_add_region_highlight() { # The calculation was relative to $PREBUFFER$BUFFER, but region_highlight is # relative to $BUFFER. - (( start -= $#PREBUFFER )) + (( start -= $#PREBUFFER )) || : (( end -= $#PREBUFFER )) (( end < 0 )) && return # having end<0 would be a bug @@ -384,7 +384,7 @@ _zsh_highlight_highlighter_main_paint() else integer offset=0 fi - ((start_pos+=offset)) + ((start_pos+=offset)) || : ((end_pos=$start_pos+${#arg})) fi diff --git a/zsh-syntax-highlighting.zsh b/zsh-syntax-highlighting.zsh index ec01306..df295ff 100644 --- a/zsh-syntax-highlighting.zsh +++ b/zsh-syntax-highlighting.zsh @@ -65,8 +65,11 @@ _zsh_highlight() return $ret fi - setopt localoptions warncreateglobal - setopt localoptions noksharrays +# Did a couple of tweaks to highlighters/main/main-highlighter.zsh +# to prevent need for following, thut there'll surely be others. +# setopt localtraps +# unfunction TRAPZERR + setopt localoptions noksharrays warncreateglobal local REPLY # don't leak $REPLY into global scope # Do not highlight if there are more than 300 chars in the buffer. It's most