~sircmpwn/gmni

0b55ef24a1fcea1a1edcc8209faa34bc2f7bf664 — René Wagner 5 months ago 9b95e38
add hints to history for easier navigation

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.
1 files changed, 8 insertions(+), 4 deletions(-)

M src/gmnlm.c
M src/gmnlm.c => src/gmnlm.c +8 -4
@@ 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;