about summary refs log tree commit diff stats
path: root/xombrero.c
diff options
context:
space:
mode:
authorJosh Rickmar <jrick@devio.us>2012-06-26 09:45:25 -0400
committerJosh Rickmar <jrick@devio.us>2012-06-28 15:29:46 -0400
commit708b5e49dca962e66b774416aefdd377040bc55c (patch)
tree6500f9a6fffafd8f234575c5e1c7984096966f48 /xombrero.c
parent778314350a27c698799439f8e4d5c3b3e536f492 (diff)
downloadxombrero-708b5e49dca962e66b774416aefdd377040bc55c.tar.gz
Implement a tabonly command that deletes all tabs except the currently
focused one. Document in manpage.
Diffstat (limited to 'xombrero.c')
-rw-r--r--xombrero.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/xombrero.c b/xombrero.c
index d1a8eab..88fab6d 100644
--- a/xombrero.c
+++ b/xombrero.c
@@ -2544,7 +2544,7 @@ tabaction(struct tab *t, struct karg *args)
 	int			rv = XT_CB_HANDLED;
 	char			*url = args->s;
 	struct undo		*u;
-	struct tab		*tt;
+	struct tab		*tt, *tv;
 
 	DNPRINTF(XT_D_TAB, "tabaction: %p %d\n", t, args->i);
 
@@ -2574,6 +2574,11 @@ tabaction(struct tab *t, struct karg *args)
 		else
 			quit(t, args);
 		break;
+	case XT_TAB_ONLY:
+		TAILQ_FOREACH_SAFE(tt, &tabs, entry, tv)
+			if (t != tt)
+				delete_tab(tt);
+		break;
 	case XT_TAB_OPEN:
 		if (strlen(url) > 0)
 			;
@@ -3316,6 +3321,7 @@ struct cmd {
 	{ "tabnew",		0,	tabaction,		XT_TAB_NEW,		XT_PREFIX | XT_URLARG },
 	{ "tabnext",		0,	movetab,		XT_TAB_NEXT,		XT_PREFIX | XT_INTARG},
 	{ "tabnextstyle",	0,	tabaction,		XT_TAB_NEXTSTYLE,	0 },
+	{ "tabonly",		0,	tabaction,		XT_TAB_ONLY,		0 },
 	{ "tabprevious",	0,	movetab,		XT_TAB_PREV,		XT_PREFIX | XT_INTARG},
 	{ "tabrewind",		0,	movetab,		XT_TAB_FIRST,		0 },
 	{ "tabshow",		0,	tabaction,		XT_TAB_SHOW,		0 },