From: Sven Wischnowsky <wischnow@informatik.hu-berlin.de>
To: zsh-workers@sunsite.auc.dk
Subject: PATCH: Re: _path_files and glob qualifiers
Date: Mon, 29 May 2000 15:09:28 +0200 (MET DST) [thread overview]
Message-ID: <200005291309.PAA07914@beta.informatik.hu-berlin.de> (raw)
In-Reply-To: "Bart Schaefer"'s message of Mon, 29 May 2000 10:06:05 +0000
Bart Schaefer wrote:
> On May 29, 11:54am, Sven Wischnowsky wrote:
> } Subject: Re: _path_files and glob qualifiers
> }
> } Maybe when doing matching, we should copy all qualifiers from the line
> } to the patterns used when generating matches (and remove the
> } qualifiers for matching purposes).
>
> That would probably work.
At least for this case, it looks good...
Bye
Sven
Index: Completion/Core/_path_files
===================================================================
RCS file: /cvsroot/zsh/zsh/Completion/Core/_path_files,v
retrieving revision 1.15
diff -u -r1.15 _path_files
--- Completion/Core/_path_files 2000/05/25 12:01:38 1.15
+++ Completion/Core/_path_files 2000/05/29 13:08:15
@@ -147,6 +147,29 @@
zstyle -s ":completion:${curcontext}:files" ignore-parents ignpar
+if [[ -n "$compstate[pattern_match]" &&
+ ( ( -z "$SUFFIX" && "$PREFIX" = *\([^\|\~]##\) ) ||
+ "$SUFFIX" = *\([^\|\~]##\) ) ]]; then
+ if [[ "$SUFFIX" = *\([^\|\~]##\) ]]; then
+ tmp3="${${(M)SUFFIX%\([^\|\~]##\)}[2,-2]}"
+ SUFFIX="${SUFFIX%\($tmp3\)}"
+ else
+ tmp3="${${(M)PREFIX%\([^\|\~]##\)}[2,-2]}"
+ PREFIX="${PREFIX%\($tmp3\)}"
+ fi
+ tmp2=()
+ for tmp1 in "$pats[@]"; do
+ if [[ "$tmp1" = (#b)(?*)(\(\([^\|~]##\)\)) ]]; then
+ tmp2=( "$tmp2[@]" "${match[1]}((${tmp3}${match[2][3,-1]}" )
+ elif [[ "$tmp1" = (#b)(?*)(\([^\|~]##\)) ]]; then
+ tmp2=( "$tmp2[@]" "${match[1]}(${tmp3}${match[2][2,-1]}" )
+ else
+ tmp2=( "$tmp2[@]" "${tmp1}(${tmp3})" )
+ fi
+ done
+ pats=( "$tmp2[@]" )
+fi
+
# We get the prefix and the suffix from the line and save the whole
# original string. Then we see if we will do menucompletion.
--
Sven Wischnowsky wischnow@informatik.hu-berlin.de
reply other threads:[~2000-05-29 13:10 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=200005291309.PAA07914@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).