* PATCH: Re: colonic _values with paths
@ 2000-04-18 12:23 Sven Wischnowsky
0 siblings, 0 replies; only message in thread
From: Sven Wischnowsky @ 2000-04-18 12:23 UTC (permalink / raw)
To: zsh-workers
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@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2000-04-18 12:25 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-04-18 12:23 PATCH: Re: colonic _values with paths Sven Wischnowsky
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).