Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
PATCH: more example cleanup
- X-seq: zsh-workers 5599
- From: Sven Wischnowsky <wischnow@xxxxxxxxxxxxxxxxxxxxxxx>
- To: zsh-workers@xxxxxxxxxxxxxx
- Subject: PATCH: more example cleanup
- Date: Tue, 2 Mar 1999 10:16:18 +0100 (MET)
- Mailing-list: contact zsh-workers-help@xxxxxxxxxxxxxx; run by ezmlm
`_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@xxxxxxxxxxxxxxxxxxxxxxx
Messages sorted by:
Reverse Date,
Date,
Thread,
Author