From db663c824a1b7167618c41d72b0c25a69b7ee91c Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Wed, 5 Apr 2000 08:49:50 +0000 Subject: $PENDING special zle parameter, giving number of un-read bytes --- Functions/Zle/incremental-complete-word | 42 ++++++++++++++++++--------------- 1 file changed, 23 insertions(+), 19 deletions(-) (limited to 'Functions') diff --git a/Functions/Zle/incremental-complete-word b/Functions/Zle/incremental-complete-word index e021bf6f7..6e61f5998 100644 --- a/Functions/Zle/incremental-complete-word +++ b/Functions/Zle/incremental-complete-word @@ -75,27 +75,31 @@ incremental-complete-word() { else LBUFFER="$LBUFFER$key" fi - lastl="$LBUFFER" - lastr="$RBUFFER" - [[ "$twid" = "$wid" ]] && comppostfuncs=( "$post[@]" ) - toolong='' - zle $twid "$@" - LBUFFER="$lastl" - RBUFFER="$lastr" - num=$_lastcomp[nmatches] - if (( ! num )); then - word='' - state='-no match-' - elif [[ "${LBUFFER}${RBUFFER}" = *${_lastcomp[unambiguous]}* ]]; then - word='' - state='-no prefix-' + if (( ! PENDING )); then + lastl="$LBUFFER" + lastr="$RBUFFER" + [[ "$twid" = "$wid" ]] && comppostfuncs=( "$post[@]" ) + toolong='' + zle $twid "$@" + LBUFFER="$lastl" + RBUFFER="$lastr" + num=$_lastcomp[nmatches] + if (( ! num )); then + word='' + state='-no match-' + elif [[ "${LBUFFER}${RBUFFER}" = *${_lastcomp[unambiguous]}* ]]; then + word='' + state='-no prefix-' + else + word="${_lastcomp[unambiguous]}" + state='' + fi + zformat -f pstr "$pmpt" "u:${word}" "s:$state" "n:$num" \ + "l:$toolong" "c:${_lastcomp[completer][2,-1]}" + zle -R "$pstr" else - word="${_lastcomp[unambiguous]}" - state='' + zle -R fi - zformat -f pstr "$pmpt" "u:${word}" "s:$state" "n:$num" \ - "l:$toolong" "c:${_lastcomp[completer][2,-1]}" - zle -R "$pstr" read -k key done -- cgit 1.4.1