Unverified Commit 16de5140 authored by Simon Rogers's avatar Simon Rogers Committed by Marc Cornellà

feat(lib): allow setting custom completion dots sequence (#9424)

Closes #9424
Closes #9703
Co-authored-by: 's avatarmortezadadgar <mortezadadgar97@gmail.com>
Co-authored-by: 's avatarMarc Cornellà <hello@mcornella.com>
parent 3e4b5201
...@@ -58,9 +58,12 @@ zstyle ':completion:*:*:*:users' ignored-patterns \ ...@@ -58,9 +58,12 @@ zstyle ':completion:*:*:*:users' ignored-patterns \
# ... unless we really want to. # ... unless we really want to.
zstyle '*' single-ignored show zstyle '*' single-ignored show
if [[ $COMPLETION_WAITING_DOTS = true ]]; then if [[ ${COMPLETION_WAITING_DOTS:-false} != false ]]; then
expand-or-complete-with-dots() { 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 expand-or-complete
zle redisplay zle redisplay
} }
......
...@@ -45,8 +45,9 @@ ZSH_THEME="robbyrussell" ...@@ -45,8 +45,9 @@ ZSH_THEME="robbyrussell"
# ENABLE_CORRECTION="true" # ENABLE_CORRECTION="true"
# Uncomment the following line to display red dots whilst waiting for completion. # Uncomment the following line to display red dots whilst waiting for completion.
# Caution: this setting can cause issues with multiline prompts (zsh 5.7.1 and newer seem to work) # You can also set it to another string to have that shown instead of the default red dots.
# See https://github.com/ohmyzsh/ohmyzsh/issues/5765 # e.g. COMPLETION_WAITING_DOTS="%F{yellow}waiting...%f"
# Caution: this setting can cause issues with multiline prompts in zsh < 5.7.1 (see #5765)
# COMPLETION_WAITING_DOTS="true" # COMPLETION_WAITING_DOTS="true"
# Uncomment the following line if you want to disable marking untracked files # Uncomment the following line if you want to disable marking untracked files
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment