* PATCH: more example cleanup
@ 1999-03-02 9:16 Sven Wischnowsky
0 siblings, 0 replies; only message in thread
From: Sven Wischnowsky @ 1999-03-02 9:16 UTC (permalink / raw)
To: zsh-workers
`_path_files' had some problems with completion after `./' and `../'
and `_comp_parts' had problems if the array of possible matches it
builds contained empty strings.
Bye
Sven
diff -u oc/Core/_comp_parts Completion/Core/_comp_parts
--- oc/Core/_comp_parts Mon Mar 1 13:13:15 1999
+++ Completion/Core/_comp_parts Tue Mar 2 09:11:21 1999
@@ -65,6 +65,7 @@
_match_pattern _comp_parts test matchflags
test="${matchflags}${test}"
testarr=( "${(@M)${(@P)arr}:#${~test}*}" )
+ testarr=( "${(@)testarr:#}" )
# If there are no matches we give up. If there is more than one
# match, this is the part we will complete.
@@ -91,6 +92,7 @@
_match_pattern _comp_parts test matchflags
test="${matchflags}${test}"
testarr=( "${(@M)${(@P)arr}:#${~test}*}" )
+ testarr=( "${(@)testarr:#}" )
fi
[[ $#testarr -eq 0 || ${#testarr[1]} -eq 0 ]] && return
@@ -124,7 +126,9 @@
tmparr=( ${=arr[2,-2]} )
arr=tmparr
fi
- suffixes=("${^suffixes[@]}${1}${(@M)^${(@P)arr}:#${~test}*}")
+ tmparr=( "${(@M)${(@P)arr}:#${~test}*}" )
+ tmparr=( "${(@)testarr:#}" )
+ suffixes=("${^suffixes[@]}${1}$^tmparr")
# We want the completion code to generate the most specific suffix
# for us, so we collect matching specifications that allow partial
diff -u oc/Core/_path_files Completion/Core/_path_files
--- oc/Core/_path_files Mon Mar 1 18:22:59 1999
+++ Completion/Core/_path_files Tue Mar 2 09:16:37 1999
@@ -183,7 +183,7 @@
# have special meaning for globbing, we remove them. But before that, we
# add the pattern for matching any characters before a slash.
-patstr="$patstr:gs-/-*/-:gs/*.*.//:gs-/*.-/.-:gs/**/*/"
+patstr="$patstr:gs-/-*/-:gs/*.*.//:gs-/*.-/.-:gs/**/*/:gs-.*/-./-"
# First we skip over all pathname components in `str' which really exist in
# the file-system, so that `/usr/lib/l<TAB>' doesn't offer you `lib' and
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~1999-03-02 9:17 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1999-03-02 9:16 PATCH: more example cleanup 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).