zsh-workers
 help / color / mirror / code / Atom feed
From: Holger Weiss <holger@CIS.FU-Berlin.DE>
To: Zsh Workers <zsh-workers@sunsite.dk>
Subject: [PATCH] Fix anchoring for vi-history-search-* widgets
Date: Sun, 6 Sep 2009 23:28:55 +0200	[thread overview]
Message-ID: <20090906212855.GA71836209@Waran.CIS.FU-Berlin.DE> (raw)

According to the zshzle(1) manual, the search string specified via
vi-history-search-backward or vi-history-search-forward "may begin with
`^' to anchor the search to the beginning of the line."  This didn't
work, because the code which compares the search string with a given
history entry checked whether the latter is a prefix of the former,
instead of the other way around.
---
 Src/Zle/zle_hist.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/Src/Zle/zle_hist.c b/Src/Zle/zle_hist.c
index c9ffda4..5b57f44 100644
--- a/Src/Zle/zle_hist.c
+++ b/Src/Zle/zle_hist.c
@@ -1942,7 +1942,7 @@ virepeatsearch(UNUSED(char **args))
 	    continue;
 	zt = GETZLETEXT(he);
 	if (zlinecmp(zt, zlemetaline) &&
-	    (*visrchstr == '^' ? strpfx(zt, visrchstr + 1) :
+	    (*visrchstr == '^' ? strpfx(visrchstr + 1, zt) :
 	     zlinefind(zt, 0, visrchstr, 1, 1) != 0)) {
 	    if (--n <= 0) {
 		unmetafy_line();
-- 
Holger


                 reply	other threads:[~2009-09-06 21:29 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=20090906212855.GA71836209@Waran.CIS.FU-Berlin.DE \
    --to=holger@cis.fu-berlin.de \
    --cc=zsh-workers@sunsite.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).