From cd80a163cb932c3a8ed59fab1ab1126410dcae2e Mon Sep 17 00:00:00 2001 From: Joey Marianer Date: Sun, 8 Jan 2017 14:29:07 -0800 Subject: [PATCH] Support :tabonly. Code shamelessly copied from the close-other-tabs extension. --- lib/ex.coffee | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/ex.coffee b/lib/ex.coffee index 7c9a6fa..b3d7513 100644 --- a/lib/ex.coffee +++ b/lib/ex.coffee @@ -163,6 +163,16 @@ class Ex tabp: => @tabprevious() + tabonly: -> + tabBar = atom.workspace.getPanes()[0] + tabBarElement = atom.views.getView(tabBar).querySelector(".tab-bar") + tabBarElement.querySelector(".right-clicked") && tabBarElement.querySelector(".right-clicked").classList.remove("right-clicked") + tabBarElement.querySelector(".active").classList.add("right-clicked") + atom.commands.dispatch(tabBarElement, 'tabs:close-other-tabs') + tabBarElement.querySelector(".active").classList.remove("right-clicked") + + tabo: => @tabonly() + edit: ({ range, args, editor }) -> filePath = args.trim() if filePath[0] is '!'