* RE: all completions
@ 2000-10-10 8:11 Sven Wischnowsky
2000-10-10 8:18 ` OT: cvs usage Andrej Borsenkow
0 siblings, 1 reply; 2+ messages in thread
From: Sven Wischnowsky @ 2000-10-10 8:11 UTC (permalink / raw)
To: zsh-workers
Andrej Borsenkow wrote:
> > The patch also contains a completer, _all_matches,
>
> Pardon me, it does not :-) This is the problem with newly added files - you
> have first to 'cvs add' them; then you can generate patch with 'cvs diff -N'.
> Else 'cvs diff -N' ingnores newly born files.
Since this is a test-patch which isn't committed, this hasn't anything
to do with cvs. It's a matter of my little brain forgatting to create
an empty file in the directory I'm diffing against. Sigh.
Bye
Sven
--- ../oz/Completion/Core/_all_matches Tue Oct 10 10:07:05 2000
+++ Completion/Core/_all_matches Mon Oct 9 21:15:04 2000
@@ -0,0 +1,35 @@
+#autoload
+
+_all_matches() {
+ local old
+
+ zstyle -s ":completion:${curcontext}:" old-matches old
+
+ if [[ "$old" = (only|true|yes|1|on) ]]; then
+
+ if [[ -n "$compstate[old_list]" ]]; then
+ compstate[insert]=all
+ compstate[old_list]=keep
+ return 0
+ fi
+
+ [[ "$old" = *only* ]] && return 1
+ fi
+
+ (( $comppostfuncs[(I)_all_matches_end] )) ||
+ comppostfuncs=( "$comppostfuncs[@]" _all_matches_end )
+
+ return 1
+}
+
+_all_matches_end() {
+ if [[ "$compstate[nmatches]" -gt 1 ]]; then
+ local disp expl
+
+ _description all-matches expl 'all matches'
+ disp=('all matches...')
+ compadd "$expl[@]" -C -d disp
+ fi
+}
+
+_all_matches "$@"
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2000-10-10 8:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-10-10 8:11 all completions Sven Wischnowsky
2000-10-10 8:18 ` OT: cvs usage Andrej Borsenkow
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).