From: Jasper Lievisse Adriaanse Subject: Re: tog: handle Home/End for log and diff views To: Tracey Emery Cc: Christian Weisgerber , gameoftrees@openbsd.org Date: Fri, 3 Sep 2021 23:46:12 +0200 > On 3 Sep 2021, at 22:14, Tracey Emery wrote: > > On Fri, Sep 03, 2021 at 09:55:15PM +0200, Christian Weisgerber wrote: >> Jasper Lievisse Adriaanse: >> >>> Here's a diff that allows one to quickly navigate to the first or last >>> item of a particular view. Currently I've implemented it for the diff and >>> log views as these are the ones I use most often. >> >>> diff --git a/tog/tog.1 b/tog/tog.1 >> >> Heresy!! Oops! ;) >>> --- a/tog/tog.c >>> +++ b/tog/tog.c >>> @@ -2406,6 +2406,14 @@ input_log_view(struct tog_view **new_view, struct tog_view *view, int ch) >>> log_scroll_up(s, 1); >>> select_commit(s); >>> break; >>> + case KEY_HOME: >>> + if (s->first_displayed_entry == NULL) >>> + break; >>> + >>> + s->selected = 0; >>> + log_scroll_up(s, s->commits.ncommits); >>> + select_commit(s); >>> + break; >>> case KEY_PPAGE: >>> case CTRL('b'): >>> if (s->first_displayed_entry == NULL) >> >> We can directly go to the head of the list, we don't need to traverse >> it backwards. Thanks, that’s much simpler. Ok with me.