"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: tog: always open help in fullscreen
To:
Mark Jamsek <mark@jamsek.com>
Cc:
Game of Trees <gameoftrees@openbsd.org>
Date:
Sun, 18 Sep 2022 20:47:57 +0200

Download raw body.

Thread
On Mon, Sep 19, 2022 at 12:06:58AM +1000, Mark Jamsek wrote:
> I went to change tog help so that the view takes over the calling view
> as stsp suggested. However, I looked at some other apps first to see how
> it's usually handled and it seems that help views typically consume the
> full screen irrespective of what splits or view configuration is
> displayed when called.
> 
> For example, tig opens help in fullscreen regardless of what views are
> open, and cycling views is disabled till help is exited. I admittedly
> find tig somewhat unintuitive but to be fair I first tried it a couple
> weeks ago so I'm not at all familiar with it.
> 
> I have `set pager_index_lines=6` in mutt so that mail is opened in
> a horizontal split but help is opened in fullscreen.
> 
> I don't use many other TUIs that have splits, but ones I use regularly
> like catgirl, hackernews, and nnn command a fullscreen (or a dialog
> that mostly obscures the calling view) for help until it's closed. Vim
> seems to be the outlier here in that it opens help in a horizontal
> split, while vi(1) uses a fullsreen.
> 
> 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.

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)