mirror of
https://github.com/zdharma-continuum/history-search-multi-word
synced 2024-11-21 19:03:11 +00:00
*highlight: Optimization: no need to use REPLY in *check-path
parse.zsh -oo, after changes: Running time: 1.6844930000 num calls time self name ----------------------------------------------------------------------------------- 1) 350 1677,00 4,79 99,99% 1227,55 3,51 73,20% -hsmw-highlight-process 2) 2800 328,17 0,12 19,57% 328,17 0,12 19,57% -hsmw-highlight-string 3) 2450 79,04 0,03 4,71% 79,04 0,03 4,71% -hsmw-highlight-check-path 4) 1400 24,98 0,02 1,49% 24,98 0,02 1,49% -hsmw-highlight-main-type 5) 350 9,73 0,03 0,58% 9,73 0,03 0,58% -hsmw-highlight-stack-pop 6) 350 7,53 0,02 0,45% 7,53 0,02 0,45% -hsmw-highlight-path-separators 7) 1 0,08 0,08 0,00% 0,08 0,08 0,00% -hsmw-highlight-fill-option-variables 8) 1 0,01 0,01 0,00% 0,01 0,01 0,00% -hsmw-highlight-init
This commit is contained in:
parent
bd1a7c4d7b
commit
07569cd060
1 changed files with 2 additions and 4 deletions
|
@ -493,7 +493,7 @@ __HSMW_HIGHLIGHT_TOKENS_TYPES=(
|
|||
braces_stack='R'"$braces_stack"
|
||||
else
|
||||
if -hsmw-highlight-check-path; then
|
||||
style=$REPLY
|
||||
style=path
|
||||
else
|
||||
style=unknown-token
|
||||
fi
|
||||
|
@ -563,7 +563,7 @@ __HSMW_HIGHLIGHT_TOKENS_TYPES=(
|
|||
style=redirection
|
||||
else
|
||||
if -hsmw-highlight-check-path; then
|
||||
style=$REPLY
|
||||
style=path
|
||||
else
|
||||
style=default
|
||||
fi
|
||||
|
@ -624,8 +624,6 @@ __HSMW_HIGHLIGHT_TOKENS_TYPES=(
|
|||
{
|
||||
: ${expanded_path:=${(Q)~arg}}
|
||||
|
||||
REPLY=path
|
||||
|
||||
[[ -z $expanded_path ]] && return 1
|
||||
[[ -L $expanded_path ]] && return 0
|
||||
[[ -e $expanded_path ]] && return 0
|
||||
|
|
Loading…
Reference in a new issue