Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Re: Correction of files after ~/
- X-seq: zsh-workers 13730
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxx
- Subject: PATCH: Re: Correction of files after ~/
- Date: Fri, 23 Mar 2001 14:57:42 +0100 (MET)
- In-reply-to: Peter Stephenson's message of Fri, 23 Mar 2001 10:47:43 +0000
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
Peter Stephenson wrote:
> ...
>
> Here's edited highlights --- I don't have time to look at this at the
> moment. I'm trying to complete ~/src/zsh/Completion/Usr which should turn
> the last part into User. This is the part of the plot from where it
> correctly tries the path with one approximation up to where it gives up and
> tries it with two approximations. It works fine if I replace ~ with
> /home/pws.
>
> Same behaviour with zsh -f with the single style
> zstyle ':completion:*' completer _oldlist _expand _complete _approximate
> which is what I normally use.
Indeed. There certainly once was a reason for that special casing in
_approximate's compadd(). But it seems to work now. I don't remember
why I did that -- and the C-code has changed since then. Let's try.
Bye
Sven
Index: Completion/Core/_approximate
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_approximate,v
retrieving revision 1.5
diff -u -r1.5 _approximate
--- Completion/Core/_approximate 2000/05/19 08:26:47 1.5
+++ Completion/Core/_approximate 2001/03/23 13:57:01
@@ -53,11 +53,12 @@
[[ ${argv[(I)-[a-zA-Z]#U[a-zA-Z]#]} -eq 0 &&
"${#:-$PREFIX$SUFFIX}" -le _comp_correct ]] && return
- if [[ "$PREFIX" = \~*/* ]]; then
- PREFIX="${PREFIX%%/*}/(#a${_comp_correct})${PREFIX#*/}"
- else
+ ### This distinction doesn't seem to be needed anymore
+ # if [[ "$PREFIX" = \~*/* ]]; then
+ # PREFIX="${PREFIX%%/*}/(#a${_comp_correct})${PREFIX#*/}"
+ # else
PREFIX="(#a${_comp_correct})$PREFIX"
- fi
+ # fi
builtin compadd "$_correct_expl[@]" "$@"
}
fi
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author