From f5b3768e8a918d2a5dcb1c7e6828311c9742cb59 Mon Sep 17 00:00:00 2001 From: WormHeamer Date: Fri, 2 Jan 2026 01:08:32 -0500 Subject: show messages for search wrapped or not found --- main.c | 10 ++++++---- 1 file 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; -- cgit v1.2.3