commit - 1304bbdd971edc6bf8cd0c8794ebe5c2dc098bb3
commit + 1b81bc33f2da0429e38dbf920d66a008a12f00e9
blob - c4c393e2504b728044683b9ef7ec0a0c1bf43845
blob + b0558831f7a6761a7634ca4575a4584061380000
--- ui.c
+++ ui.c
#define TAB_CURRENT 0x1
+#define NEW_TAB_URL "about:new"
+
static struct event stdioev, winchev;
static void load_default_keys(void);
static void enter_minibuffer(void(*)(void), void(*)(void), void(*)(void), struct histhead*);
static void exit_minibuffer(void);
static void switch_to_tab(struct tab*);
-static struct tab *new_tab(void);
+static struct tab *new_tab(const char*);
static struct { int meta, key; } thiskey;
static void
cmd_push_button_new_tab(struct tab *tab)
{
- struct tab *t;
struct vline *vl;
size_t nth;
if (vl->parent->type != LINE_LINK)
return;
- t = new_tab();
- memcpy(&t->url, &tab->url, sizeof(tab->url));
- load_url_in_tab(t, vl->parent->alt);
+ new_tab(vl->parent->alt);
}
static void
static void
cmd_tab_new(struct tab *tab)
{
- new_tab();
+ new_tab(NEW_TAB_URL);
}
static void
}
static struct tab *
-new_tab(void)
+new_tab(const char *url)
{
struct tab *tab;
- const char *url = "about:new";
if ((tab = calloc(1, sizeof(*tab))) == NULL)
goto err;
signal_set(&winchev, SIGWINCH, handle_resize, NULL);
signal_add(&winchev, NULL);
- new_tab();
+ new_tab(NEW_TAB_URL);
return 1;
}