From cedd1006e661b990aaa8881c2efd4116bed574a3 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Tue, 13 Jun 2000 09:05:35 +0000 Subject: fixes for calling compfiles, for completing words with special characters; make compfiles optimisations work with globcomplete and simple match (sunsite isn't responding) --- Completion/Core/_path_files | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'Completion') diff --git a/Completion/Core/_path_files b/Completion/Core/_path_files index 5673e7c4a..7f6f83184 100644 --- a/Completion/Core/_path_files +++ b/Completion/Core/_path_files @@ -5,7 +5,7 @@ local linepath realpath donepath prepath testpath exppath skips skipped local tmp1 tmp2 tmp3 tmp4 i orig eorig pre suf tpre tsuf opre osuf cpre -local pats haspats ignore pfxsfx sopt gopt opt sdirs ignpar +local pats haspats ignore pfxsfx sopt gopt opt sdirs ignpar cfopt local nm=$compstate[nmatches] menu matcher mopts sort match mid typeset -U prepaths exppaths @@ -185,6 +185,7 @@ eorig="$orig" [[ $compstate[insert] = (*menu|[0-9]*) || -n "$_comp_correct" || ( -n "$compstate[pattern_match]" && "${orig#\~}" != (|*[^\\])[][*?#~^\|\<\>]* ) ]] && menu=yes +[[ -n "$_comp_correct" ]] && cfopt=- # Now let's have a closer look at the string to complete. @@ -222,7 +223,7 @@ if [[ "$pre[1]" = \~ && -z "$compstate[quote]" ]]; then elif [[ tmp -le $#dirstack ]]; then realpath=$dirstack[tmp]/ else - _message 'not directory stack entries' + _message 'not enough directory stack entries' return 1 fi elif [[ "$linepath" = [-+] ]]; then @@ -313,11 +314,11 @@ for prepath in "$prepaths[@]"; do # Get the matching files by globbing. if [[ "$tpre$tsuf" = */* ]]; then - compfiles -P tmp1 "$skipped" "$_matcher" "$sdirs" + compfiles -P$cfopt tmp1 "$skipped" "$_matcher" "$sdirs" elif [[ "$sopt" = *[/f]* ]]; then - compfiles -p tmp1 "$skipped" "$_matcher" "$sdirs" "$pats" + compfiles -p$cfopt tmp1 "$skipped" "$_matcher" "$sdirs" "$pats[@]" else - compfiles -p tmp1 "$skipped" "$_matcher" '' "$pats" + compfiles -p$cfopt tmp1 "$skipped" "$_matcher" '' "$pats[@]" fi tmp1=( $~tmp1 ) -- cgit 1.4.1