mirror of
https://github.com/zdharma-continuum/history-search-multi-word
synced 2024-11-21 19:03:11 +00:00
*highlight: Optimization: remove *-check-assign call
This commit is contained in:
parent
d2fbc7eb37
commit
ab439966ee
1 changed files with 2 additions and 9 deletions
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue