mirror of
https://github.com/zsh-users/zsh-syntax-highlighting.git
synced 2025-02-13 10:05:31 +08:00
more ERR trap fixes
This commit is contained in:
parent
4d0c5604d9
commit
0bac9581bb
@ -214,7 +214,7 @@ _zsh_highlight_highlighter_main_paint()
|
|||||||
integer multi_func_def=0
|
integer multi_func_def=0
|
||||||
fi
|
fi
|
||||||
emulate -L zsh
|
emulate -L zsh
|
||||||
setopt localoptions extendedglob bareglobqual
|
setopt localoptions extendedglob bareglobqual #xtrace
|
||||||
|
|
||||||
# At the PS3 prompt and in vared, highlight nothing.
|
# At the PS3 prompt and in vared, highlight nothing.
|
||||||
#
|
#
|
||||||
@ -537,7 +537,9 @@ _zsh_highlight_highlighter_main_paint()
|
|||||||
style=alias
|
style=alias
|
||||||
_zsh_highlight_main__resolve_alias $arg
|
_zsh_highlight_main__resolve_alias $arg
|
||||||
local alias_target="$REPLY"
|
local alias_target="$REPLY"
|
||||||
[[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_PRECOMMANDS:#"$alias_target"} && -z ${(M)ZSH_HIGHLIGHT_TOKENS_PRECOMMANDS:#"$arg"} ]] && ZSH_HIGHLIGHT_TOKENS_PRECOMMANDS+=($arg)
|
[[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_PRECOMMANDS:#"$alias_target"}
|
||||||
|
&& -z ${(M)ZSH_HIGHLIGHT_TOKENS_PRECOMMANDS:#"$arg"} ]] &&
|
||||||
|
ZSH_HIGHLIGHT_TOKENS_PRECOMMANDS+=($arg) || :
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
;;
|
;;
|
||||||
@ -684,7 +686,7 @@ _zsh_highlight_highlighter_main_paint()
|
|||||||
fi
|
fi
|
||||||
if ! (( already_added )); then
|
if ! (( already_added )); then
|
||||||
_zsh_highlight_main_add_region_highlight $start_pos $end_pos $style
|
_zsh_highlight_main_add_region_highlight $start_pos $end_pos $style
|
||||||
[[ $style == path || $style == path_prefix ]] && _zsh_highlight_main_highlighter_highlight_path_separators
|
[[ $style == path || $style == path_prefix ]] && _zsh_highlight_main_highlighter_highlight_path_separators || :
|
||||||
fi
|
fi
|
||||||
if [[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_COMMANDSEPARATOR:#"$arg"} ]]; then
|
if [[ -n ${(M)ZSH_HIGHLIGHT_TOKENS_COMMANDSEPARATOR:#"$arg"} ]]; then
|
||||||
if [[ $arg == ';' ]] && $in_array_assignment; then
|
if [[ $arg == ';' ]] && $in_array_assignment; then
|
||||||
|
@ -66,7 +66,7 @@ _zsh_highlight()
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# Did a couple of tweaks to highlighters/main/main-highlighter.zsh
|
# Did a couple of tweaks to highlighters/main/main-highlighter.zsh
|
||||||
# to prevent need for following, though there'll surely be others.
|
# to prevent need for following, though there'll surely be other areas.
|
||||||
# setopt localtraps
|
# setopt localtraps
|
||||||
# unfunction TRAPZERR
|
# unfunction TRAPZERR
|
||||||
setopt localoptions noksharrays warncreateglobal
|
setopt localoptions noksharrays warncreateglobal
|
||||||
@ -172,6 +172,9 @@ _zsh_highlight_apply_zle_highlight() {
|
|||||||
local entry="$1" default="$2"
|
local entry="$1" default="$2"
|
||||||
integer first="$3" second="$4"
|
integer first="$3" second="$4"
|
||||||
|
|
||||||
|
setopt localoptions unset # seems to be the accessing the array entry
|
||||||
|
# rather than ${entry-} that aborts otherwise
|
||||||
|
|
||||||
# read the relevant entry from zle_highlight
|
# read the relevant entry from zle_highlight
|
||||||
local region="${zle_highlight[(r)${entry}:*]}"
|
local region="${zle_highlight[(r)${entry}:*]}"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user