       [ tab, tabs... ] = tabs[startTabIndex...startTabIndex + count]
       chrome.windows.create {tabId: tab.id, incognito: tab.incognito}, (window) ->
         chrome.tabs.move (tab.id for tab in tabs), {windowId: window.id, index: -1}
+        return
+      return
+    return
+
   nextTab: (request) -> selectTab "next", request
   previousTab: (request) -> selectTab "previous", request
   firstTab: (request) -> selectTab "first", request

      tabs = [tabs[position...]..., tabs[...position]...]
      count = Math.min count, tabs.length
      chrome.tabs.reload tab.id, {bypassCache} for tab in tabs[...count]

forCountTabs = (count, currentTab, callback) ->
  chrome.tabs.query {currentWindow: true}, (tabs) ->
    activeTabIndex = currentTab.index
    startTabIndex = Math.max 0, Math.min activeTabIndex, tabs.length - count
    callback tab for tab in tabs[startTabIndex...startTabIndex + count]

# Remove tabs before, after, or either side of the currently active tab
removeTabsRelative = (direction, {tab: activeTab}) ->


    tabConfig.active = request.active if request.active?
    # Firefox does not support "about:newtab" in chrome.tabs.create.
    if tabConfig["url"] == Settings.defaults.newTabUrl
      delete tabConfig["url"]

    # Firefox <57 throws an error when openerTabId is used (issue 1238314).
    canUseOpenerTabId = not (Utils.isFirefox() and Utils.compareVersions(Utils.firefoxVersion(), "57") < 0)
    if canUseOpenerTabId
      tabConfig.openerTabId = request.tab.id

    chrome.tabs.create tabConfig, (tab) ->
      # clean position and active, so following `openUrlInNewTab(request)` will create a tab just next to this new tab
