mirror of
https://github.com/zdharma-continuum/history-search-multi-word
synced 2024-11-28 14:20:20 +00:00
*highlight: Optimization: don't declare "pos" when not needed, in *tors
-hsmw-highlight-path-separators runs 1.5 - 2 ms faster
This commit is contained in:
parent
ae8990c53b
commit
8cd7464b85
1 changed files with 1 additions and 1 deletions
|
@ -591,8 +591,8 @@ __HSMW_HIGHLIGHT_TOKENS_TYPES=(
|
|||
|
||||
-hsmw-highlight-path-separators()
|
||||
{
|
||||
local pos
|
||||
[[ -z "$HSMW_HIGHLIGHT_STYLES[path_pathseparator]" || "$HSMW_HIGHLIGHT_STYLES[path]" == "$HSMW_HIGHLIGHT_STYLES[path_pathseparator]" ]] && return 0
|
||||
local pos
|
||||
for (( pos = start_pos; pos <= end_pos; pos++ )) ; do
|
||||
# ADD
|
||||
[[ ${buf[pos]} == "/" ]] && reply+=("$(( pos - 1 )) $pos ${HSMW_HIGHLIGHT_STYLES[$style_pathsep]}")
|
||||
|
|
Loading…
Reference in a new issue