diff options
| -rw-r--r-- | main.c | 10 |
1 files changed, 6 insertions, 4 deletions
@@ -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; |
