~sircmpwn/gmni-devel

gmni: add hints to history for easier navigation v1 APPLIED

~rwa: 1
 add hints to history for easier navigation

 1 files changed, 8 insertions(+), 4 deletions(-)
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/23574/mbox | git am -3
Learn more about email & git
View this thread in the archives

[PATCH gmni] add hints to history for easier navigation Export this patch

From: René Wagner <rwa@clttr.info>

This commit adds simple hints in front of the URIs on the history
page to directly show what needs to be typed to jump to this page.
---
 src/gmnlm.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/src/gmnlm.c b/src/gmnlm.c
index b1c08b2..710473b 100644
--- a/src/gmnlm.c
+++ b/src/gmnlm.c
@@ -598,15 +598,19 @@ do_prompts(const char *prompt, struct browser *browser)
	case 'H':
		if (in[1]) break;
		struct history *cur = browser->history;
		while (cur->prev) cur = cur->prev;
		int hist_count = 0;
		while (cur->prev) {
			cur = cur->prev;
			hist_count++;
		}
		while (cur != browser->history) {
			fprintf(browser->tty, "  %s\n", cur->url);
			fprintf(browser->tty, "b%-3i %s\n", hist_count--, cur->url);
			cur = cur->next;
		}
		fprintf(browser->tty, "* %s\n", cur->url);
		fprintf(browser->tty, "*    %s\n", cur->url);
		cur = cur->next;
		while (cur) {
			fprintf(browser->tty, "  %s\n", cur->url);
			fprintf(browser->tty, "f%-3i %s\n", ++hist_count, cur->url);
			cur = cur->next;
		}
		result = PROMPT_AGAIN;
-- 
2.30.2
Thanks!

To git@git.sr.ht:~sircmpwn/gmni
   0b55ef2..9b95e38  master -> master