commit - 568eae9578c8babb5be9eea6c85b9e016a6cdb29
commit + f83ada346bec1ad98dda1d8f0ee7e95551ff4780
blob - 536b7b498bd4706495d95afcbdf091af274ce20d
blob + 3bb7704fbbba7e7851db72c19e9a7bbd520ae5db
--- tog/tog.c
+++ tog/tog.c
entry = TAILQ_PREV(s->search_entry,
commit_queue_head, entry);
} else if (s->matched_entry) {
- int matched_idx = s->matched_entry->idx;
- int selected_idx = s->selected_entry->idx;
-
/*
* If the user has moved the cursor after we hit a match,
* the position from where we should continue searching
* might have changed.
*/
- if (view->searching == TOG_SEARCH_FORWARD) {
- if (matched_idx > selected_idx)
- entry = TAILQ_NEXT(s->selected_entry, entry);
- else
- entry = TAILQ_NEXT(s->matched_entry, entry);
- } else {
- if (matched_idx < selected_idx)
- entry = TAILQ_PREV(s->selected_entry,
- commit_queue_head, entry);
- else
- entry = TAILQ_PREV(s->matched_entry,
- commit_queue_head, entry);
- }
+ if (view->searching == TOG_SEARCH_FORWARD)
+ entry = TAILQ_NEXT(s->selected_entry, entry);
+ else
+ entry = TAILQ_PREV(s->selected_entry, commit_queue_head,
+ entry);
} else {
entry = s->selected_entry;
}