commit - 693188cbff678ee0934f5fe5da91365614864888
commit + ed504b9e1a0307a13e869cb3296f07ec072dae42
blob - 1aac903783e44a8036b0c1808fae51a11727d5d9
blob + b5c5d74d817371346a6e8417ac61ba82031627c7
--- cmd.c
+++ cmd.c
message("pages: %zu, total: %s", npages, fmt);
else
message("pages: %zu, total: %zu", npages, tot);
+}
+
+void
+cmd_reply_last_input(struct buffer *buffer)
+{
+ GUARD_RECURSIVE_MINIBUFFER();
+
+ if (current_tab->last_input_url == NULL) {
+ message("there was no previous input request in this tab");
+ return;
+ }
+
+ message("%s", current_tab->last_input_url);
+ ui_require_input(current_tab, 0, ir_select_reply);
}
blob - 62dba1eb923cd3ef15581965e9c2db818ab99e8c
blob + a4fd3fbd593dc70791e26dc9239884f3769cacbd
--- cmd.h
+++ cmd.h
CMD(cmd_push_button_new_tab, "Follow link at point in a new tab.n");
CMD(cmd_redraw, "Redraw the screen.");
CMD(cmd_reload_page, "Reload the current page.");
+CMD(cmd_reply_last_input, "Reply last input request.");
CMD(cmd_scroll_down, "Scroll down by one visual page");
CMD(cmd_scroll_line_down, "Scroll down by one line");
CMD(cmd_scroll_line_up, "Scroll up by one line.");
blob - 047685c6e6d886f1213c4dae7d9a21764232ae15
blob + c4e4304a0600bfe0a8cf9f7acc9bd453ada08787
--- defaults.c
+++ defaults.c
global_set_key("M-l", cmd_link_select);
global_set_key("M-/", cmd_swiper);
global_set_key("t", cmd_toc);
+ global_set_key("M-r", cmd_reply_last_input);
/* === minibuffer map === */
minibuffer_set_key("ret", cmd_mini_complete_and_exit);
blob - ce5a8b929512ff8d10fd521ba878f014fed97ef9
blob + 6f2e28cb6d6926f95e7b914d57a2dc0fab120741
--- minibuffer.c
+++ minibuffer.c
/* a bit ugly but... */
memcpy(&uri, &tab->uri, sizeof(tab->uri));
+ phos_uri_set_query(&uri, ministate.buf);
+ phos_serialize_uri(&uri, buf, sizeof(buf));
+ load_url_in_tab(tab, buf, NULL, LU_MODE_NOCACHE);
+}
+
+void
+ir_select_reply(void)
+{
+ char buf[1025] = {0};
+ struct phos_uri uri;
+ struct tab *tab = current_tab;
+
+ exit_minibuffer();
+ minibuffer_hist_save_entry();
+
+ /* a bit ugly but... */
+ strlcpy(buf, tab->last_input_url, sizeof(buf));
+ phos_parse_absolute_uri(buf, &uri);
phos_uri_set_query(&uri, ministate.buf);
phos_serialize_uri(&uri, buf, sizeof(buf));
load_url_in_tab(tab, buf, NULL, LU_MODE_NOCACHE);
blob - 4388609c5677976c7328ef4a22e25c32e4e72c1f
blob + 70795ac34c8058672ee0a2487c150076873f97b8
--- minibuffer.h
+++ minibuffer.h
void sensible_self_insert(void);
void eecmd_select(void);
void ir_select_gemini(void);
+void ir_select_reply(void);
void ir_select_gopher(void);
void lu_select(void);
void bp_select(void);
blob - 473b28c04befb9e50c13079a38f6d0453493302c
blob + 675bf515111430b8cf3f85838b48c092a0bafe3e
--- telescope.c
+++ telescope.c
if (tab->code < 10) { /* internal errors */
load_page_from_str(tab, err_pages[tab->code]);
} else if (tab->code < 20) { /* 1x */
+ free(tab->last_input_url);
+ tab->last_input_url = strdup(tab->hist_cur->h);
+ if (tab->last_input_url == NULL)
+ die();
+
load_page_from_str(tab, err_pages[tab->code]);
ui_require_input(tab, tab->code == 11, ir_select_gemini);
} else if (tab->code == 20) {
blob - 06a9bd417000d3c81facb3e263499c6baefaa976
blob + 21778771969b58af00d8f60052518efdf7759955
--- telescope.h
+++ telescope.h
struct histhead hist;
struct hist *hist_cur;
size_t hist_off;
+ char *last_input_url;
int code;
char meta[GEMINI_URL_LEN];