From bf46e538022db645e7c6d6a0e502e7add9872a15 Mon Sep 17 00:00:00 2001 From: Michal Mazurek Date: Tue, 2 Aug 2011 19:24:42 +0000 Subject: Add the gototab buffer command. This is diff bcmd #3. ok marco --- xxxterm.1 | 3 +++ xxxterm.c | 17 +++++++++++++++++ 2 files changed, 20 insertions(+) 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 @@ -6575,6 +6575,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) { @@ -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 }, -- cgit 1.4.1-2-gfad0