From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23426 invoked by alias); 21 Sep 2015 22:05:42 -0000 Mailing-List: contact zsh-workers-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Workers List List-Post: List-Help: X-Seq: 36586 Received: (qmail 24661 invoked from network); 21 Sep 2015 22:05:41 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.0 X-Helo: d01dlp02.pok.ibm.com X-MailFrom: hanpt@linux.vnet.ibm.com X-RcptTo: zsh-workers@zsh.org Date: Tue, 22 Sep 2015 05:55:23 +0800 From: Han Pingtian To: zsh-workers@zsh.org Subject: matching right anchor on right Message-ID: <20150921215523.GA21203@localhost.localdomain> Mail-Followup-To: zsh-workers@zsh.org MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.23 (2014-03-12) X-TM-AS-MML: disable X-Content-Scanned: Fidelis XPS MAILER x-cbid: 15092121-0033-0000-0000-000005F79C61 Hi there, I cannot understand these code in match_str() and think it should be written like this? This make sure right anchor to be matched of the right of command line and trail word substring. Without the patch, this completion doesn't work: % zsh -f localhost% autoload init localhost% autoload compinit localhost% compinit localhost% _foo() function> compadd -M 'r:{A-Z}|.={a-z}' foo.bar localhost% compdef _foo foo localhost% foo foO. after applying the patch, it works. --- Src/Zle/compmatch.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Src/Zle/compmatch.c b/Src/Zle/compmatch.c index 05ae43a..b090af6 100644 --- a/Src/Zle/compmatch.c +++ b/Src/Zle/compmatch.c @@ -813,10 +813,12 @@ match_str(char *l, char *w, Brinfo *bpp, int bc, int *rwlp, continue; else if (mp->right) t = pattern_match(mp->right, - tl + mp->llen - mp->ralen, + //tl + mp->llen - mp->ralen, + tl + mp->llen, NULL, NULL) && pattern_match(mp->right, - tw + mp->wlen - mp->ralen, + //tw + mp->wlen - mp->ralen, + tw + mp->wlen, NULL, NULL) && (!mp->lalen || pattern_match(mp->left, tw + mp->wlen - -- 1.9.3