From 4f3a3bd135631c220ee4fed3c8ca3f06b3b6e1e0 Mon Sep 17 00:00:00 2001 From: Nelo Wallus Date: Fri, 15 Jan 2016 14:25:58 +0100 Subject: [PATCH] Add tabattachto and tabdetachfrom tabattach and tabdetach were already taken. Line 249: For some reason tabs.match() doesn't return a generator in the script as it should while it works in the prompt. So instead we have this. --- plugins/contrib/treestyletabs.js | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/plugins/contrib/treestyletabs.js b/plugins/contrib/treestyletabs.js index c5cbaf5e..78602797 100644 --- a/plugins/contrib/treestyletabs.js +++ b/plugins/contrib/treestyletabs.js @@ -238,3 +238,32 @@ create_command_and_mapping( }, "" ) + +create_command_and_mapping( + "tabattachto", + "Attach tab as child to another tab", + function (args) { + if (args[0]) { + let tab = gBrowser.tabContainer.selectedItem; + + let parenttab = tabs.getTab(parseInt(args[0], 10) - 1); + + gBrowser.treeStyleTab.attachTabTo(tab, parenttab); + } + }, + "", + { + completer: function (context) { + completion.buffer(context, false); + } + } + ) + +create_command_and_mapping( + "tabdetachfrom", + "Detach tab from parent", + function () { + gBrowser.treeStyleTab.detachTab(gBrowser.tabContainer.selectedItem); + }, + "" + )