mirror of
https://github.com/zdharma-continuum/history-search-multi-word
synced 2024-11-24 20:33:04 +00:00
*highlight: Compress code handling assignments
This commit is contained in:
parent
0915653d7d
commit
b8f92d4f89
1 changed files with 3 additions and 7 deletions
|
@ -462,13 +462,9 @@ __HSMW_HIGHLIGHT_TOKENS_TYPES=(
|
|||
none) # Assign?
|
||||
if [[ $arg == [[:alpha:]_][[:alnum:]_]#(|\[[^\]]#\])(|[+])=* ]] || [[ $arg == [0-9]##(|[+])=* ]]; then
|
||||
style=assign
|
||||
if [[ $arg[-1] == '(' ]]; then
|
||||
in_array_assignment=1
|
||||
else
|
||||
# assignment to a scalar parameter.
|
||||
# Assignment to a scalar parameter or to array
|
||||
# (For array assignments, the command doesn't start until the ")" token.)
|
||||
(( next_word = next_word | BIT_start ))
|
||||
fi
|
||||
[[ $arg[-1] == '(' ]] && in_array_assignment=1 || (( next_word = next_word | BIT_start ))
|
||||
elif [[ $arg[0,1] = $histchars[0,1] ]] && (( $#arg[0,2] == 2 )); then
|
||||
style=history-expansion
|
||||
elif [[ $arg[0,1] == $histchars[2,2] ]]; then
|
||||
|
|
Loading…
Reference in a new issue