be used.
.SS Open
.TP
-.BI open " URI"
-Open the give \fIURI\fP into current window.
+.BI "open [" URI ]
+Open the give \fIURI\fP into current window. If \fIURI\fP is empty the
+configured 'home-page' is opened.
.TP
-.BI tabopen " URI"
-Open the give \fIURI\fP into a new window.
-.TP
-.B (tab)open-home
-Opens the configured 'home-page'.
+.BI "tabopen [" URI ]
+Open the give \fIURI\fP into a new window. If \fIURI\fP is empty the
+configured 'home-page' is opened.
.TP
.B (tab)open-closed
Open the last closed page.
static CommandInfo cmd_list[] = {
/* command function arg mode */
- {"open", command_open, {VP_TARGET_CURRENT}},
- {"tabopen", command_open, {VP_TARGET_NEW}},
- {"open-home", command_open_home, {VP_TARGET_CURRENT}},
- {"tabopen-home", command_open_home, {VP_TARGET_NEW}},
+ {"open", command_open, {VP_TARGET_CURRENT, ""}},
+ {"tabopen", command_open, {VP_TARGET_NEW, ""}},
{"open-closed", command_open_closed, {VP_TARGET_CURRENT}},
{"tabopen-closed", command_open_closed, {VP_TARGET_NEW}},
{"input", command_input, {0, ":"}},
{
char* uri = NULL;
gboolean result;
+
+ if (!arg->s || arg->s[0] == '\0') {
+ Arg a = {arg->i, vp.config.home_page};
+ return vp_load_uri(&a);
+ }
/* check for searchengine handles */
/* split into handle and searchterms */
char **string = g_strsplit(arg->s, " ", 2);
return result;
}
-gboolean command_open_home(const Arg* arg)
-{
- Arg a = {arg->i, vp.config.home_page};
- return vp_load_uri(&a);
-}
-
/**
* Reopens the last closed page.
*/
{"nmap t=input :tabopen "},
{"nmap O=inputuri :open "},
{"nmap T=inputuri :tabopen "},
- {"nmap gh=open-home"},
- {"nmap gH=tabopen-home"},
+ {"nmap gh=open"},
+ {"nmap gH=tabopen"},
{"nmap u=open-closed"},
{"nmap U=tabopen-closed"},
{"nmap d=quit"},