Skip to content
Permalink
Browse files

added "open search in new tab" (using C-Enter on search) per

  • Loading branch information...
ader Josh Rickmar
ader authored and Josh Rickmar committed May 2, 2014
1 parent b10321a commit bf6ffda86a0ae6813f32e2b9e1084dd1c4761828
Showing with 22 additions and 0 deletions.
  1. +1 −0 settings.c
  2. +21 −0 xombrero.c
@@ -1486,6 +1486,7 @@ struct key_binding keys[] = {
{ "editelement", CTRL, 1, GDK_i },
{ "passthrough", CTRL, 1, GDK_z },
{ "modurl", CTRL, 1, GDK_Return },
{ "modsearchentry", CTRL, 1, GDK_Return },
{ "urlmod plus", MOD1, 1, GDK_a },
{ "urlmod min", MOD1, 1, GDK_A },

@@ -251,6 +251,7 @@ int next_download_id = 1;
void xxx_dir(char *);
int icon_size_map(int);
void activate_uri_entry_cb(GtkWidget*, struct tab *);
void activate_search_entry_cb(GtkWidget*, struct tab *);

void
history_delete(struct command_list *l, int *counter)
@@ -1164,6 +1165,25 @@ modurl(struct tab *t, struct karg *args)
return (0);
}

int
modsearchentry(struct tab *t, struct karg *args)
{
const gchar *s = NULL;
struct tab *tt;

/* XXX kind of a bad hack (in honor of the modurl hack) */
if (gtk_widget_has_focus(t->search_entry)) {
if ((s = gtk_entry_get_text(GTK_ENTRY(t->search_entry))) &&
(strlen(s))) {
tt = create_new_tab(NULL, NULL, 1, -1);
gtk_entry_set_text(GTK_ENTRY(tt->search_entry), s);
activate_search_entry_cb(t->search_entry,tt);
gtk_entry_set_text(GTK_ENTRY(t->search_entry), "");
}
}
return (0);
}

int
hint(struct tab *t, struct karg *args)
{
@@ -3248,6 +3268,7 @@ struct cmd {
{ "editelement", 0, edit_element, 0, 0 },
{ "passthrough", 0, passthrough, 0, 0 },
{ "modurl", 0, modurl, 0, 0 },
{ "modsearchentry", 0, modsearchentry, 0, 0 },

/* yanking and pasting */
{ "yankuri", 0, yank_uri, 0, 0 },

0 comments on commit bf6ffda

Please sign in to comment.
You can’t perform that action at this time.