Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: Re: colonic _values with paths
- X-seq: zsh-workers 10807
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: PATCH: Re: colonic _values with paths
- Date: Tue, 18 Apr 2000 14:23:47 +0200 (MET DST)
- In-reply-to: Peter Stephenson's message of Tue, 18 Apr 2000 12:54:31 +0100
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
Peter Stephenson wrote:
> This is rather minor, but I happened to notice.
>
> _values always adds a suffix `:' when it's dealing with colon-separated
> arrays.
You mean `_value'. We have both of them. In the same directory.
Terribly irritating.
> This is actually pretty annoying if the elements of the array are
> paths, when you'd prefer to have the usual `/' and add a `:' by hand where
> necessary. How about only adding the `:' if the element doesn't already
> contain a `/' or initial `~'? Or suppose I get in the habit of using
> `typeset -T' and adding things to real arrays? Maybe the second
> alternative is better.
I wasn't sure which is better... this makes it insert the `/' as
usual. Unfortunately I can't think of a good way to make it add a `/'
for directories and a `:' for other files.
But at least this also makes the colon remove the slash.
Bye
Sven
Index: Completion/Base/_value
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Base/_value,v
retrieving revision 1.2
diff -u -r1.2 _value
--- Completion/Base/_value 2000/04/17 08:22:44 1.2
+++ Completion/Base/_value 2000/04/18 12:23:09
@@ -23,7 +23,7 @@
[[ "$PREFIX$SUFFIX" = *:* ]]; then
compset -P '*:'
compset -S ':*'
- _default -qS: "$@"
+ _default -r '\-\n\t /:' "$@"
else
_default "$@"
fi
@@ -46,7 +46,7 @@
elif compset -P '-R'; then
compset -P '*:'
compset -S ':*'
- _files -/ -S/ -r ' :' "$@"
+ _files -/ -S/ -r '\n\t\- /:' "$@"
else
_default "$@"
fi
--
Sven Wischnowsky wischnow@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author