From: Mark Jamsek Subject: Re: tog: always open help in fullscreen To: Game of Trees Date: Mon, 19 Sep 2022 23:21:20 +1000 On 22-09-18 08:47PM, Stefan Sperling wrote: > On Mon, Sep 19, 2022 at 12:06:58AM +1000, Mark Jamsek wrote: > > With that in mind, I thought I'd try this with tog first, and get some > > feedback. The below diff makes tog always open help in fullscreen > > irrespective of the current view configuration. And cycling views is > > disabled till help is exited. This seems to be the standard and, imo, it > > feels more intuitive than our current behaviour, and makes help distinct > > from the other views. As an added bonues it's also a minimal change! > > I like the idea. ok by me. > > By the way, should we make it easier for people to figure out > how to exit the help screen? For example, as in the patch below. Yes, good idea! ok by me with the indent of the new title passed to win_draw_center() fixed: diff /home/mark/src/got commit - 94274a8f75da950b87727bc93439723aac3ea64c path + /home/mark/src/got blob - d0e2232056d2d697f05b40c9afc178d451401450 file + tog/tog.c --- tog/tog.c +++ tog/tog.c @@ -546,7 +546,7 @@ struct tog_help_view_state { KEY_("/", "Open prompt to enter search term"), \ KEY_("n", "Find next line/token matching the current search term"), \ KEY_("N", "Find previous line/token matching the current search term"),\ - KEY_("q", "Quit the focussed view"), \ + KEY_("q", "Quit the focussed view; Quit help screen"), \ KEY_("Q", "Quit tog"), \ \ KEYMAP_("Log", TOG_KEYMAP_LOG), \ @@ -8638,7 +8638,8 @@ show_help_view(struct tog_view *view) view->gline = s->nlines - 1; err = win_draw_center(view->window, 0, 0, view->ncols, - view_needs_focus_indication(view), "tog help"); + view_needs_focus_indication(view), + "tog help (press q to return to tog)"); if (err) return err; if (eos <= 1) > diff /home/stsp/src/got > commit - 1dc50d7fc1898287302559cef3e54f360ca45b75 > path + /home/stsp/src/got > blob - d0e2232056d2d697f05b40c9afc178d451401450 > file + tog/tog.c > --- tog/tog.c > +++ tog/tog.c > @@ -546,7 +546,7 @@ struct tog_help_view_state { > KEY_("/", "Open prompt to enter search term"), \ > KEY_("n", "Find next line/token matching the current search term"), \ > KEY_("N", "Find previous line/token matching the current search term"),\ > - KEY_("q", "Quit the focussed view"), \ > + KEY_("q", "Quit the focussed view; Quit help screen"), \ > KEY_("Q", "Quit tog"), \ > \ > KEYMAP_("Log", TOG_KEYMAP_LOG), \ > @@ -8638,7 +8638,8 @@ show_help_view(struct tog_view *view) > view->gline = s->nlines - 1; > > err = win_draw_center(view->window, 0, 0, view->ncols, > - view_needs_focus_indication(view), "tog help"); > + view_needs_focus_indication(view), > + "tog help (press q to return to tog)"); > if (err) > return err; > if (eos <= 1) > > -- Mark Jamsek GPG: F2FF 13DE 6A06 C471 CA80 E6E2 2930 DC66 86EE CF68