Newly opened tab order


#1

I have a prefence for opening new tabs at the end of the tab list, rather than the default behaviour (which I think is to open it after the current active tab).

Am I missing an existing way to achieve this? Or would a new setting/package be required?

I realise that I am probably a dinosaur and not up with modern related-tab thinking, but it’s how my brain works.

I also make this change in every Firefox installation I use:

browser.tabs.insertRelatedAfterCurrent = false

which gives the same (and previously default) behaviour.


#2

There is currently no setting for this, no. A new setting on the tabs package would be required, most likely.


#3

Someone should add this feature to the package tab-smart-sort.


#4

Shameless plug?

I’ll have a bash :grinning:


#5

More like shameful.


#6

You can add this to your init.coffee as a quick and dirty fix. Be warned though: the tabs will be reordered according to the current rules after you restart Atom.

atom.workspace.onDidAddPaneItem (paneItem) ->
  process.nextTick ->
    paneEl = atom.views.getView(paneItem.pane)
    activeTabEl = paneEl.querySelector('.tab-bar .tab.active')
    activeTabEl.parentNode.appendChild(activeTabEl)

Opening a new tabs
#7

I guess that’s functionally pretty similar to what I did in adding a setting to the tabs package:

addTabForItem: (item, index) ->
  tabView = new TabView()
  tabView.initialize(item)
  tabView.clearPreview() if @isItemMovingBetweenPanes
  @storePreviewTabToDestroy() if tabView.isPreviewTab
  if not atom.config.get('tabs.alwaysOpenNewTabAtEnd')
    @insertTabAtIndex(tabView, index)
  else
    @insertTabAtIndex(tabView)