summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWormHeamer2026-01-02 01:08:32 -0500
committerWormHeamer2026-01-02 01:08:32 -0500
commitf5b3768e8a918d2a5dcb1c7e6828311c9742cb59 (patch)
tree257604926aaa1ab13459a5efb75e45f091eb7f32
parent92d528ad2f406f85933c2a410594e9fc3da2c91e (diff)
show messages for search wrapped or not found
-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;