about summary refs log tree commit diff
path: root/Src/Zle
diff options
context:
space:
mode:
Diffstat (limited to 'Src/Zle')
-rw-r--r--Src/Zle/zle_hist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Src/Zle/zle_hist.c b/Src/Zle/zle_hist.c
index 203492b55..bc0598327 100644
--- a/Src/Zle/zle_hist.c
+++ b/Src/Zle/zle_hist.c
@@ -1323,7 +1323,7 @@ doisearch(char **args, int dir, int pattern)
 			} else
 			    t = zlinefind(zt, pos, sbuf, dir, sens);
 			if (t)
-			    end_pos = pos + sbptr - (sbuf[0] == '^');
+			    end_pos = (t - zt) + sbptr - (sbuf[0] == '^');
 		    }
 		}
 		if (t) {