~sircmpwn/gmni-devel

gmni: gmnlm: Improve paging behavior on narrow terminals v1 APPLIED

Zach DeCook: 2
 gmnlm: Improve paging behavior on narrow terminals
 gmnlm: Include blank line to frame browser window when reading more

 2 files changed, 7 insertions(+), 2 deletions(-)
Thanks!

To git@git.sr.ht:~sircmpwn/gmni
   e0993d4..77b73ef  master -> master
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~sircmpwn/gmni-devel/patches/21742/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH gmni 1/2] gmnlm: Improve paging behavior on narrow terminals Export this patch

---
 src/gmnlm.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/gmnlm.c b/src/gmnlm.c
index c59e68c..8c8b3d7 100644
--- a/src/gmnlm.c
+++ b/src/gmnlm.c
@@ -845,6 +845,10 @@ display_gemini(struct browser *browser, struct gemini_response *resp)
	int row = 0, col = 0;
	struct gemini_token tok;
	struct link **next = &browser->links;
	// When your screen is too narrow, more lines will be used for helptext and URL.
	// 87 is the maximum width of the prompt.
	int info_rows = (ws.ws_col >= 87) ? 4 : 6;

	while (text != NULL || gemini_parser_next(&p, &tok) == 0) {
repeat:
		switch (tok.token) {
@@ -933,7 +937,7 @@ repeat:
		if (text) {
			int w = wrap(out, text, &ws, &row, &col);
			text += w;
			if (text[0] && row < ws.ws_row - 4) {
			if (text[0] && row < ws.ws_row - info_rows) {
				continue;
			}

@@ -951,7 +955,7 @@ repeat:
		}
		++row; col = 0;

		if (browser->pagination && row >= ws.ws_row - 4) {
		if (browser->pagination && row >= ws.ws_row - info_rows) {
			char prompt[4096];
			char *end = NULL;
			if (browser->meta && (end = strchr(resp->meta, ';')) != NULL) {
-- 
2.31.0

[PATCH gmni 2/2] gmnlm: Include blank line to frame browser window when reading more Export this patch

---
 src/gmnlm.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/gmnlm.c b/src/gmnlm.c
index 8c8b3d7..57c79cf 100644
--- a/src/gmnlm.c
+++ b/src/gmnlm.c
@@ -978,6 +978,7 @@ repeat:
			switch (result) {
			case PROMPT_AGAIN:
			case PROMPT_MORE:
				printf("\n");
				break;
			case PROMPT_QUIT:
				browser->running = false;
-- 
2.31.0
Thanks!

To git@git.sr.ht:~sircmpwn/gmni
   e0993d4..77b73ef  master -> master