summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--editors/vi.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/editors/vi.c b/editors/vi.c
index 34d577e..2941b8a 100644
--- a/editors/vi.c
+++ b/editors/vi.c
@@ -2384,6 +2384,8 @@ static char *char_search(char *p, const char *pat, int dir_and_range)
memset(&preg, 0, sizeof(preg));
err = re_compile_pattern(pat, strlen(pat), &preg);
+ preg.not_bol = p != text;
+ preg.not_eol = p != end - 1;
if (err != NULL) {
status_line_bold("bad search pattern '%s': %s", pat, err);
return p;