Support :tabonly. Code shamelessly copied from the close-other-tabs extension.

This commit is contained in:
Joey Marianer 2017-01-08 14:29:07 -08:00
parent d3c3603eb4
commit cd80a163cb

View file

@ -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 '!'