From 16de51404773a5e849c25a95e7612e212e7256a7 Mon Sep 17 00:00:00 2001 From: Simon Rogers Date: Thu, 5 Nov 2020 10:40:45 +0000 Subject: feat(lib): allow setting custom completion dots sequence (#9424) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #9424 Closes #9703 Co-authored-by: mortezadadgar Co-authored-by: Marc Cornellà --- lib/completion.zsh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'lib') diff --git a/lib/completion.zsh b/lib/completion.zsh index ebaab0856..2c5695487 100644 --- a/lib/completion.zsh +++ b/lib/completion.zsh @@ -58,9 +58,12 @@ zstyle ':completion:*:*:*:users' ignored-patterns \ # ... unless we really want to. zstyle '*' single-ignored show -if [[ $COMPLETION_WAITING_DOTS = true ]]; then +if [[ ${COMPLETION_WAITING_DOTS:-false} != false ]]; then expand-or-complete-with-dots() { - print -Pn "%F{red}…%f" + # use $COMPLETION_WAITING_DOTS either as toggle or as the sequence to show + [[ $COMPLETION_WAITING_DOTS = true ]] && COMPLETION_WAITING_DOTS="%F{red}…%f" + # turn off line wrapping and print prompt-expanded "dot" sequence + printf '\e[?7l%s\e[?7h' "${(%)COMPLETION_WAITING_DOTS}" zle expand-or-complete zle redisplay } -- cgit v1.2.3-70-g09d2