From d8f703027345170c7bc820ed7808e693dd1377d6 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Sat, 25 Mar 2000 00:21:44 +0000 Subject: zsh-3.1.6-dev-20 --- Functions/Zle/incremental-complete-word | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) (limited to 'Functions/Zle/incremental-complete-word') diff --git a/Functions/Zle/incremental-complete-word b/Functions/Zle/incremental-complete-word index f69af52d5..c01bc4f6b 100644 --- a/Functions/Zle/incremental-complete-word +++ b/Functions/Zle/incremental-complete-word @@ -17,7 +17,7 @@ incremental-complete-word() { unsetopt autolist menucomplete automenu # doesn't work well local key lbuf="$LBUFFER" rbuf="$RBUFFER" pmpt pstr word - local lastl lastr wid twid num post toolong + local lastl lastr wid twid num alt post toolong local curcontext="${curcontext}" stop brk [[ -z "$curcontext" ]] && curcontext=::: @@ -41,6 +41,10 @@ incremental-complete-word() { LBUFFER="$lbuf" RBUFFER="$rbuf" num=$_lastcomp[nmatches] + if (( ! num )); then + num="${_lastcomp[alternate_nmatches]}" + alt=' -alt-' + fi if (( ! num )); then word='' state='-no match-' @@ -51,7 +55,7 @@ incremental-complete-word() { word="${_lastcomp[unambiguous]}" state='' fi - zformat -f pstr "$pmpt" "u:${word}" "s:$state" "n:$num" \ + zformat -f pstr "$pmpt" "u:${word}" "s:$state" "n:$num" "a:$alt" \ "l:$toolong" "c:${_lastcomp[completer][2,-1]}" zle -R "$pstr" read -k key @@ -83,6 +87,12 @@ incremental-complete-word() { LBUFFER="$lastl" RBUFFER="$lastr" num=$_lastcomp[nmatches] + if (( ! num )); then + num="${_lastcomp[alternate_nmatches]}" + alt=' -alt-' + else + alt='' + fi if (( ! num )); then word='' state='-no match-' @@ -93,7 +103,7 @@ incremental-complete-word() { word="${_lastcomp[unambiguous]}" state='' fi - zformat -f pstr "$pmpt" "u:${word}" "s:$state" "n:$num" \ + zformat -f pstr "$pmpt" "u:${word}" "s:$state" "n:$num" "a:$alt" \ "l:$toolong" "c:${_lastcomp[completer][2,-1]}" zle -R "$pstr" read -k key -- cgit 1.4.1