Skip to content

Commit

Permalink
Improve all-matches performance
Browse files Browse the repository at this point in the history
  • Loading branch information
marlonrichert committed Jul 4, 2021
1 parent 64077eb commit b164ae7
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion completion/_autocomplete.unambiguous
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,5 @@ local tag=unambiguous
_tags $tag
_tags && _requested $tag &&
_message -e unambiguous \
$'%B%{\e[2m%}Shift-Tab:%b %{\e[2m%}insert %b%F{0}%K{11}'"$compstate[unambiguous]%f%k"
$'%{\e[1;2;39m%}common substring:%b %F{0}%K{11}'"$compstate[unambiguous]%f%k"
# \e[2m = faint; 0 = black; 11 = bright yellow
7 changes: 6 additions & 1 deletion module/.autocomplete.async
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,13 @@ zle -N history-incremental-search-forward .autocomplete.async.history-incrementa

unset MENUSELECT

if [[ $LASTWIDGET == .autocomplete.async.complete.fd-widget ]]; then
zle -R
return 0
fi

(( KEYS_QUEUED_COUNT || PENDING )) &&
return 0
return

region_highlight=()
[[ -v functions[_zsh_highlight] ]] &&
Expand Down
7 changes: 0 additions & 7 deletions module/.autocomplete.config
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,6 @@ _autocomplete.config.warnings-format() {
reply=( $'%{\e[01;02;39m%}'"No ${${:-$PREFIX$SUFFIX}:+matching }$d found."$'%{\e[0m%}' )
}

zstyle ':completion:*:all-matches' format $'%B%{\e[2m%}Shift-Tab:%b %{\e[2m%}insert %d%b'
zstyle -e ':completion:*:all-matches' hidden _autocomplete.config.all-matches-hidden
_autocomplete.config.all-matches-hidden() {
reply=( all ); [[ $IPREFIX$PREFIX$SUFFIX$ISUFFIX == *${compstate[unambiguous]:#?}* ]] &&
reply=( yes )
}

zstyle ':completion:*:history-lines' format ''

zstyle ':completion:*' auto-description '%d'
Expand Down
2 changes: 1 addition & 1 deletion run-tests.zsh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/zsh -f
print $OSTYPE =zsh $ZSH_VERSION $ZSH_PATCHLEVEL =clitest
print $VENDOR $OSTYPE =zsh $ZSH_VERSION $ZSH_PATCHLEVEL =clitest
local +h -a fpath=( ${0:h}/*(-/) $fpath )
FPATH=$FPATH zsh -f =clitest --list-run --progress dot --prompt '%' -- ${0:h}/.clitest/*.md

0 comments on commit b164ae7

Please sign in to comment.