about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--xxxterm.12
-rw-r--r--xxxterm.c6
2 files changed, 7 insertions, 1 deletions
diff --git a/xxxterm.1 b/xxxterm.1
index 1867adf..1abfedd 100644
--- a/xxxterm.1
+++ b/xxxterm.1
@@ -163,6 +163,8 @@ Focus:
 .Bl -tag -width "tabnew, tabedit, tabe [URI]" -offset indent -compact
 .It Cm F6
 Focus on URI entry
+.It Cm F7
+Focus on search entry
 .El
 .Pp
 Navigation:
diff --git a/xxxterm.c b/xxxterm.c
index 2aaa035..37a5b44 100644
--- a/xxxterm.c
+++ b/xxxterm.c
@@ -160,6 +160,7 @@ struct karg {
 
 #define XT_FOCUS_INVALID	(0)
 #define XT_FOCUS_URI		(1)
+#define XT_FOCUS_SEARCH		(2)
 
 #define XT_SEARCH_INVALID	(0)
 #define XT_SEARCH_NEXT		(1)
@@ -415,11 +416,13 @@ quit(struct tab *t, struct karg *args)
 int
 focus(struct tab *t, struct karg *args)
 {
-	if (t == NULL)
+	if (t == NULL || args == NULL)
 		errx(1, "focus");
 
 	if (args->i == XT_FOCUS_URI)
 		gtk_widget_grab_focus(GTK_WIDGET(t->uri_entry));
+	if (args->i == XT_FOCUS_SEARCH)
+		gtk_widget_grab_focus(GTK_WIDGET(t->search_entry));
 
 	return (0);
 }
@@ -869,6 +872,7 @@ struct key {
 
 	/* focus */
 	{ 0,			0,	GDK_F6,		focus,		{.i = XT_FOCUS_URI} },
+	{ 0,			0,	GDK_F7,		focus,		{.i = XT_FOCUS_SEARCH} },
 
 	/* navigation */
 	{ 0,			0,	GDK_BackSpace,	navaction,	{.i = XT_NAV_BACK} },