Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
[PATCH] Fix anchoring for vi-history-search-* widgets
- X-seq: zsh-workers 27248
- From: Holger Weiss <holger@xxxxxxxxxxxxxxxx>
- To: Zsh Workers <zsh-workers@xxxxxxxxxx>
- Subject: [PATCH] Fix anchoring for vi-history-search-* widgets
- Date: Sun, 6 Sep 2009 23:28:55 +0200
- Mail-followup-to: Zsh Workers <zsh-workers@xxxxxxxxxx>
- Mailing-list: contact zsh-workers-help@xxxxxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author