summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/main.c b/main.c
index 302f336..9325a11 100644
--- a/main.c
+++ b/main.c
@@ -723,8 +723,10 @@ search_from_start:;
if (match_found == 0) {
match_found = -1;
l = txt_start(l.t);
+ e.msg = S("wrapped");
goto search_from_start;
}
+ e.msg = S("no match");
return 0;
}
@@ -768,8 +770,10 @@ search_from_end:
match_found = -1;
l = txt_end(l.t);
end = start;
+ e.msg = S("wrapped");
goto search_from_end;
}
+ e.msg = S("no match");
return 0;
}
@@ -951,16 +955,14 @@ repeat_char_search:;
case '/':
if (read_search()) {
- TxtLoc r;
- if (search_next_regex(l, e.search, &r)) l = r;
+ if (!search_next_regex(l, e.search, &l)) return 0;
e.search_dir = 1;
}
break;
case '?':
if (read_search()) {
- TxtLoc r;
- if (search_prev_regex(l, e.search, &r)) l = r;
+ if (!search_prev_regex(l, e.search, &l)) return 0;
e.search_dir = -1;
}
break;