From 4240140fb354dc005db61d7d754c609941268f8a Mon Sep 17 00:00:00 2001 From: Eric Nielsen Date: Wed, 4 Apr 2018 18:52:22 -0500 Subject: [PATCH] [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 . See #85. Fixes #134 --- modules/input/init.zsh | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/modules/input/init.zsh b/modules/input/init.zsh index 6fb2bde..17d5b32 100644 --- a/modules/input/init.zsh +++ b/modules/input/init.zsh @@ -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 -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 + 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() {