zsh-workers
 help / color / mirror / code / Atom feed
* [PATCH] Fix anchoring for vi-history-search-* widgets
@ 2009-09-06 21:28 Holger Weiss
  0 siblings, 0 replies; only message in thread
From: Holger Weiss @ 2009-09-06 21:28 UTC (permalink / raw)
  To: Zsh Workers

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


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-09-06 21:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-09-06 21:28 [PATCH] Fix anchoring for vi-history-search-* widgets Holger Weiss

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).