diff options
| author | Jez Ng | 2012-09-08 16:37:05 -0400 |
|---|---|---|
| committer | Jez Ng | 2012-09-08 16:37:05 -0400 |
| commit | adf8b7cc617279e50594477560ec7031e2ab68ea (patch) | |
| tree | f43660994fb29770bd38e4b11cc11d828ecc0615 /background_scripts/main.coffee | |
| parent | 3e5bba24ede4f9392ff666634a0a8f05e21a02d1 (diff) | |
| parent | e740ea52b646f1b7cd0ef13e15571b20adaa3bd8 (diff) | |
| download | vimium-adf8b7cc617279e50594477560ec7031e2ab68ea.tar.bz2 | |
Merge branch 'next-release'
Diffstat (limited to 'background_scripts/main.coffee')
| -rw-r--r-- | background_scripts/main.coffee | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index bc3fde0b..a3857d61 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -265,17 +265,17 @@ selectTab = (callback, direction) -> chrome.tabs.getAllInWindow(null, (tabs) -> return unless tabs.length > 1 chrome.tabs.getSelected(null, (currentTab) -> - switch direction - when "next" - toSelect = tabs[(currentTab.index + 1 + tabs.length) % tabs.length] - when "previous" - toSelect = tabs[(currentTab.index - 1 + tabs.length) % tabs.length] - when "first" - toSelect = tabs[0] - when "last" - toSelect = tabs[tabs.length - 1] - selectionChangedHandlers.push(callback) - chrome.tabs.update(toSelect.id, { selected: true }))) + switch direction + when "next" + toSelect = tabs[(currentTab.index + 1 + tabs.length) % tabs.length] + when "previous" + toSelect = tabs[(currentTab.index - 1 + tabs.length) % tabs.length] + when "first" + toSelect = tabs[0] + when "last" + toSelect = tabs[tabs.length - 1] + selectionChangedHandlers.push(callback) + chrome.tabs.update(toSelect.id, { selected: true }))) updateOpenTabs = (tab) -> openTabs[tab.id] = { url: tab.url, positionIndex: tab.index, windowId: tab.windowId } @@ -367,7 +367,7 @@ updatePositionsAndWindowsForAllTabsInWindow = (windowId) -> splitKeyIntoFirstAndSecond = (key) -> if (key.search(namedKeyRegex) == 0) - { first: RegExp.$1, second: RegExp.$2 } + { first: RegExp.$1, second: RegExp.$2 } else { first: key[0], second: key.slice(1) } @@ -409,7 +409,7 @@ generateCompletionKeys = (keysToCheck) -> for key of Commands.keyToCommandRegistry splitKey = splitKeyIntoFirstAndSecond(key) if (splitKey.first == command) - completionKeys.push(splitKey.second) + completionKeys.push(splitKey.second) completionKeys |
