summaryrefslogtreecommitdiff
path: root/lib/completion.zsh
diff options
context:
space:
mode:
authorTuowen Zhao <ztuowen@gmail.com>2021-09-27 13:03:58 -0600
committerTuowen Zhao <ztuowen@gmail.com>2021-09-27 13:03:58 -0600
commitc674485e6b4abe313469900997d893d2940ee843 (patch)
treed6ca6edaff3d81849489f31ca13b127acef89c75 /lib/completion.zsh
parent3c73976ef306d68a85d60c94be9a1dcdc33fa2bf (diff)
parent93ad3a88214b95f571e03c21f7d9bd76f9110938 (diff)
downloadzsh-c674485e6b4abe313469900997d893d2940ee843.tar.gz
zsh-c674485e6b4abe313469900997d893d2940ee843.tar.bz2
zsh-c674485e6b4abe313469900997d893d2940ee843.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'lib/completion.zsh')
-rw-r--r--lib/completion.zsh7
1 files changed, 5 insertions, 2 deletions
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
}