[input] fix prompt after <Tab><Tab><Ctrl-C>
The issue is fixed by adding `zle redisplay` after `zle expand-and-complete` for the expand-and-complete key binding. An additional `print -n '...'` is also included to show an indicator while the menu is loading, and that is purely cosmetic. There's still one glitch: the prompt jumps one line up after <Tab><Tab><Ctrl-C>. This was observed in Prezto too. Fixes #85, closes #89
This commit is contained in:
parent
0a9d105107
commit
7519f17645
1 changed files with 9 additions and 0 deletions
|
@ -102,6 +102,15 @@ 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>
|
||||||
|
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
|
||||||
|
|
||||||
# Put into application mode and validate ${terminfo}
|
# Put into application mode and validate ${terminfo}
|
||||||
zle-line-init() {
|
zle-line-init() {
|
||||||
if (( ${+terminfo[smkx]} )); then
|
if (( ${+terminfo[smkx]} )); then
|
||||||
|
|
Loading…
Reference in a new issue