Merge pull request #172 from jmarianer/tabonly

[needs tests] Support :tabonly. Code shamelessly copied from the close-other-tabs extension.
This commit is contained in:
Jasper v. B 2017-01-19 21:51:01 +01:00 committed by GitHub
commit e2c42a6eeb

View file

@ -163,6 +163,16 @@ class Ex
tabp: => @tabprevious() 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 }) -> edit: ({ range, args, editor }) ->
filePath = args.trim() filePath = args.trim()
if filePath[0] is '!' if filePath[0] is '!'