Been looking into this further. It appears the tabs plugin subscribes to the “pane:item-added” command to open items in a new tab (see https://github.com/atom/tabs/blob/master/lib/tab-bar-view.coffee#L27-L29). I’m thinking what I want to do is stop propagation to the tab view, so that I can load the item into the existing tab instead. Unfortunately, it looks like the tabs plugin is getting loaded before mine, therefore its subscription is getting called before mine. Is there any way to control the load order so mine is called first and I can stop propagation to tabs?
Edit: Did a little more digging, looks like we have one of two options here:
- Can I insert myself into the subscription chain before tabs? This sounds like a bad idea, but then again so does
tab-bar-view trigger an event before a tab is opened that allows me to cancel the tab opening, but it still updates the tab state; this is bad because it’d be better if tabs knew nothing about this behavior
I can’t think of a better option than #1 at the moment. I’m also falling asleep as I type this, so maybe I need to reapproach this with a fresh mind. Does anyone else have any ideas?