commit - 8f4ed63441b6c8e9c29c4db32ad615a1657aa1ac
commit + f9967bca13c359aa4ba51c67a63fad42f9569626
blob - e4a29913017c957f0d4f8e06cdd86094f3999c58
blob + 627443ff42c81342f3b1dd935e34b99a36b0a211
--- tog/tog.c
+++ tog/tog.c
int search_next_done;
#define TOG_SEARCH_HAVE_MORE 1
#define TOG_SEARCH_NO_MORE 2
+#define TOG_SEARCH_HAVE_NONE 3
regex_t regex;
};
*dead = NULL;
*focus = NULL;
- /* Clear "no more matches" indicator. */
- if (view->search_next_done == TOG_SEARCH_NO_MORE)
+ /* Clear "no matches" indicator. */
+ if (view->search_next_done == TOG_SEARCH_NO_MORE ||
+ view->search_next_done == TOG_SEARCH_HAVE_NONE)
view->search_next_done = TOG_SEARCH_HAVE_MORE;
if (view->searching && !view->search_next_done) {
if (asprintf(&ncommits_str, " [%d/%d] %s",
entry ? entry->idx + 1 : 0, commits->ncommits,
view->search_next_done == TOG_SEARCH_NO_MORE ?
- "no more matches" : (refs_str ? refs_str : "")) == -1) {
+ "no more matches" :
+ (view->search_next_done == TOG_SEARCH_HAVE_NONE ?
+ "no matches found" : (refs_str ? refs_str : ""))) == -1) {
err = got_error_from_errno("asprintf");
goto done;
}
if (entry == NULL) {
if (s->thread_args.log_complete ||
view->searching == TOG_SEARCH_BACKWARD) {
- view->search_next_done = TOG_SEARCH_NO_MORE;
+ view->search_next_done =
+ (s->matched_entry == NULL ?
+ TOG_SEARCH_HAVE_NONE : TOG_SEARCH_NO_MORE);
s->search_entry = NULL;
return NULL;
}