[input] Use custom expand-or-complete in zsh < 5.3

as `expand-or-complete-with-redisplay` was added to fix an issue
reported with zsh 5.2 when completing with <Tab><Tab><Ctrl-C>. See #85.

Fixes #134. Closes #256
This commit is contained in:
Eric Nielsen 2018-04-13 15:15:54 -05:00 committed by GitHub
parent 8655867ca2
commit 26dce76d28
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 10 additions and 8 deletions

View File

@ -102,14 +102,16 @@ if [[ -n "${key_info[BackTab]}" ]]; then
bindkey "${key_info[BackTab]}" reverse-menu-complete
fi
# Redisplay after completing, and avoid blank prompt after <Tab><Tab><Ctrl-C>
expand-or-complete-with-redisplay() {
print -n '...'
zle expand-or-complete
zle redisplay
}
zle -N expand-or-complete-with-redisplay
bindkey "${key_info[Control]}I" expand-or-complete-with-redisplay
autoload -Uz is-at-least && if ! is-at-least 5.3; then
# Redisplay after completing, and avoid blank prompt after <Tab><Tab><Ctrl-C>
expand-or-complete-with-redisplay() {
print -Pn '...'
zle expand-or-complete
zle redisplay
}
zle -N expand-or-complete-with-redisplay
bindkey "${key_info[Control]}I" expand-or-complete-with-redisplay
fi
# Put into application mode and validate ${terminfo}
zle-line-init() {