mirror of
https://github.com/zdharma-continuum/history-search-multi-word
synced 2024-11-25 12:50:25 +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;;
|
function) style=function;;
|
||||||
command) style=command;;
|
command) style=command;;
|
||||||
hashed) style=hashed-command;;
|
hashed) style=hashed-command;;
|
||||||
none) if -hsmw-highlight-check-assign; then
|
none) # Assign?
|
||||||
|
if [[ $arg == [[:alpha:]_][[:alnum:]_]#(|\[*\])(|[+])=* ]] || [[ $arg == [0-9]##(|[+])=* ]]; then
|
||||||
style=assign
|
style=assign
|
||||||
if [[ $arg[-1] == '(' ]]; then
|
if [[ $arg[-1] == '(' ]]; then
|
||||||
in_array_assignment=true
|
in_array_assignment=true
|
||||||
|
@ -621,14 +622,6 @@ typeset -gA HSMW_HIGHLIGHT_STYLES
|
||||||
done
|
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()
|
-hsmw-highlight-path-separators()
|
||||||
{
|
{
|
||||||
local pos style_pathsep
|
local pos style_pathsep
|
||||||
|
|
Loading…
Reference in a new issue