1
0
Fork 0
mirror of synced 2024-09-07 14:46:22 -04:00

[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

View file

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