*highlight: Optimization: remove *-check-assign call

This commit is contained in:
Sebastian Gniazdowski 2016-10-17 06:48:44 +02:00
parent d2fbc7eb37
commit ab439966ee

View file

@ -442,7 +442,8 @@ typeset -gA HSMW_HIGHLIGHT_STYLES
function) style=function;;
command) style=command;;
hashed) style=hashed-command;;
none) if -hsmw-highlight-check-assign; then
none) # Assign?
if [[ $arg == [[:alpha:]_][[:alnum:]_]#(|\[*\])(|[+])=* ]] || [[ $arg == [0-9]##(|[+])=* ]]; then
style=assign
if [[ $arg[-1] == '(' ]]; then
in_array_assignment=true
@ -621,14 +622,6 @@ typeset -gA HSMW_HIGHLIGHT_STYLES
done
}
# Check if $arg is variable assignment
-hsmw-highlight-check-assign()
{
setopt localoptions extended_glob
[[ $arg == [[:alpha:]_][[:alnum:]_]#(|\[*\])(|[+])=* ]] ||
[[ $arg == [0-9]##(|[+])=* ]]
}
-hsmw-highlight-path-separators()
{
local pos style_pathsep