From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: more example cleanup
Date: Tue, 2 Mar 1999 10:16:18 +0100 (MET) [thread overview]
Message-ID: <199903020916.KAA17070@beta.informatik.hu-berlin.de> (raw)
`_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
reply other threads:[~1999-03-02 9:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=199903020916.KAA17070@beta.informatik.hu-berlin.de \
--to=wischnow@informatik.hu-berlin.de \
--cc=zsh-workers@sunsite.auc.dk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).