From 647674f6abe8e6fd01bb115af88b43304ab00025 Mon Sep 17 00:00:00 2001 From: Sven Wischnowsky Date: Mon, 20 Aug 2001 13:13:49 +0000 Subject: undo most of 15650, do that in shell code (15669) --- Completion/Base/Completer/_approximate | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'Completion/Base') diff --git a/Completion/Base/Completer/_approximate b/Completion/Base/Completer/_approximate index 3ed8be730..39518803e 100644 --- a/Completion/Base/Completer/_approximate +++ b/Completion/Base/Completer/_approximate @@ -49,15 +49,16 @@ _tags corrections original if (( ! $+functions[compadd] )); then compadd() { + local ppre="$argv[(I)-p]" + [[ ${argv[(I)-[a-zA-Z]#U[a-zA-Z]#]} -eq 0 && "${#:-$PREFIX$SUFFIX}" -le _comp_correct ]] && return - ### This distinction doesn't seem to be needed anymore - # if [[ "$PREFIX" = \~*/* ]]; then - # PREFIX="${PREFIX%%/*}/(#a${_comp_correct})${PREFIX#*/}" - # else + if [[ "$PREFIX" = \~* && ( ppre -eq 0 || "$argv[ppre+1]" != \~* ) ]]; then + PREFIX="~(#a${_comp_correct})${PREFIX[2,-1]}" + else PREFIX="(#a${_comp_correct})$PREFIX" - # fi + fi (( $_correct_group && $argv[(I)-*[JV]] )) && _correct_expl[_correct_group]=${argv[(R)-*[JV]]} -- cgit 1.4.1