commit 479ea9e74f4b66645c0d7b51d99adf420d831f23
parent d3afac098e2bf0a4ed9fad89f6a748f6288ae3bc
Author: René Wagner <rwagner@rw-net.de>
Date: Tue, 9 Mar 2021 17:22:19 +0100
add s command for searching in geminispace
Diffstat:
2 files changed, 7 insertions(+), 0 deletions(-)
diff --git a/README.md b/README.md
@@ -24,6 +24,7 @@ This project is of fork of https://git.sr.ht/~sircmpwn/gmni
It includes the following modifications:
- colored headings & links
- default 4 char indenting
+- s command to directly search in geminispace (via geminispace.info)
- k command to remove the bookmark for the current page
- e[N] command to open a link in default external program (requires `xdg-open`)
- t[N] command to download the content behind a link to a temporary file
diff --git a/src/gmnlm.c b/src/gmnlm.c
@@ -93,6 +93,7 @@ const char *help_msg =
"M\t\tBrowse bookmarks\n"
"k\t\tRemove bookmark for current page\n"
"r\t\tReload the page\n"
+ "s\t\tSearch via geminispace.info\n"
"/<text>\t\tsearch for text (POSIX regular expression)\n"
"n\t\tjump to next search match\n"
"d <path>\tDownload page to <path>\n"
@@ -568,6 +569,11 @@ do_prompts(const char *prompt, struct browser *browser)
if (in[1]) break;
result = PROMPT_QUIT;
goto exit;
+ case 's':
+ if (in[1]) break;
+ set_url(browser, "gemini://geminispace.info/search", &browser->history);
+ result = PROMPT_ANSWERED;
+ goto exit;
case 'b':
if (in[1]) historyhops =(int)strtol(in+1, &endptr, 10);
while (historyhops > 0) {