commit - d4e1ff4fd2ac79e0a03f75cdc784d71e0543b3c1
commit + 96e2b5666a7a0dee0f96c1c95a61f6f46379b2ec
blob - 9093d146d73b7a7a674302c46508a638d9c6a5af
blob + 32a713754ee76dc6be18d1aae5862daa875005f9
--- tog/tog.c
+++ tog/tog.c
pthread_t thread;
struct tog_log_thread_args thread_args;
struct commit_queue_entry *matched_entry;
+ struct commit_queue_entry *search_entry;
};
struct tog_blame_cb_args {
struct tog_log_view_state *s = &view->state.log;
s->matched_entry = NULL;
+ s->search_entry = NULL;
return NULL;
}
return NULL;
}
- if (s->matched_entry) {
+ if (s->search_entry) {
+ if (view->searching == TOG_SEARCH_FORWARD)
+ entry = TAILQ_NEXT(s->search_entry, entry);
+ else
+ entry = TAILQ_PREV(s->search_entry,
+ commit_queue_head, entry);
+ } else if (s->matched_entry) {
if (view->searching == TOG_SEARCH_FORWARD)
entry = TAILQ_NEXT(s->selected_entry, entry);
else
view->search_next_done = 1;
return NULL;
}
+ /*
+ * Poke the log thread for more commits and return,
+ * allowing the main loop to make progress. Search
+ * will resume at s->search_entry once we come back.
+ */
s->thread_args.commits_needed = 1;
return trigger_log_thread(0,
&s->thread_args.commits_needed,
break;
}
free(id_str);
+ s->search_entry = entry;
if (view->searching == TOG_SEARCH_FORWARD)
entry = TAILQ_NEXT(entry, entry);
else
}
}
+ s->search_entry = NULL;
+
return NULL;
}