about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorMichal Mazurek <akfaew@jasminek.net>2011-08-02 19:24:42 +0000
committerMichal Mazurek <akfaew@jasminek.net>2011-08-02 19:24:42 +0000
commitbf46e538022db645e7c6d6a0e502e7add9872a15 (patch)
treecf31f7e0d9bf65c06ba5c971991cf1c2243289d3
parent526d5e45302852af0fa8f949a8a55f7f35c043fc (diff)
downloadxombrero-bf46e538022db645e7c6d6a0e502e7add9872a15.tar.gz
Add the gototab buffer command. This is diff bcmd #3.
ok marco
-rw-r--r--xxxterm.13
-rw-r--r--xxxterm.c17
2 files changed, 20 insertions, 0 deletions
diff --git a/xxxterm.1 b/xxxterm.1
index 34952bb..aa7da40 100644
--- a/xxxterm.1
+++ b/xxxterm.1
@@ -563,6 +563,9 @@ go to the bottom of the page
 percent of the page
 .It Cm gh
 open the home page in the current tab
+.It Cm [0-9]+t
+activate tab number
+.Cm arg
 .It Cm ZZ
 quit
 .Nm
diff --git a/xxxterm.c b/xxxterm.c
index 597adde..88121ac 100644
--- a/xxxterm.c
+++ b/xxxterm.c
@@ -6576,6 +6576,22 @@ webview_hover_cb(WebKitWebView *wv, gchar *title, gchar *uri, struct tab *t)
 }
 
 int
+gototab(struct tab *t, struct karg *args)
+{
+	int		tab;
+	struct karg	arg = {0, NULL, -1};
+
+	tab = atoi(args->s);
+
+	arg.i = XT_TAB_NEXT;
+	arg.p = tab;
+
+	movetab(t, &arg);
+
+	return 0;
+}
+
+int
 zoom_amount(struct tab *t, struct karg *arg)
 {
 	struct karg	narg = {0, NULL, -1};
@@ -6597,6 +6613,7 @@ struct buffercmd {
 	{ "^gg$",               move,           XT_MOVE_TOP },
 	{ "^gG$",               move,           XT_MOVE_BOTTOM },
 	{ "^gh$",               go_home,        0 },
+	{ "^[0-9]+t$",		gototab,	0 },
 	{ "^ZR$",               restart,        0 },
 	{ "^ZZ$",               quit,           0 },
 	{ "^zi$",               resizetab,      XT_ZOOM_IN },