diff options
| author | Stephen Blott | 2016-09-17 08:03:25 +0100 |
|---|---|---|
| committer | Stephen Blott | 2016-09-17 08:04:38 +0100 |
| commit | d6b3845a8a9d7604bad7f1a24d87c39bdc116125 (patch) | |
| tree | b6889e42b7ab576912c556e61ad90b4007018096 | |
| parent | 48e3893076a6ca93223743bee73b713721070eb5 (diff) | |
| download | vimium-d6b3845a8a9d7604bad7f1a24d87c39bdc116125.tar.bz2 | |
Tweaks to comments.
| -rw-r--r-- | background_scripts/marks.coffee | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/background_scripts/marks.coffee b/background_scripts/marks.coffee index 963b8925..dbc14671 100644 --- a/background_scripts/marks.coffee +++ b/background_scripts/marks.coffee @@ -64,7 +64,8 @@ Marks = # or we create a new tab. focusOrLaunch: (markInfo, req) -> # If we're not going to be scrolling to a particular position in the tab, then we choose all tabs with a - # matching URL prefix. Otherwise, we require an exact match. + # matching URL prefix. Otherwise, we require an exact match (because it doesn't make sense to scroll + # unless there's an exact URL match). query = if markInfo.scrollX == markInfo.scrollY == 0 then "#{markInfo.url}*" else markInfo.url chrome.tabs.query { url: query }, (tabs) => if 0 < tabs.length @@ -85,7 +86,8 @@ Marks = # Prefer tabs in the current window, if there are any. tabsInWindow = tabs.filter (tab) -> tab.windowId == id tabs = tabsInWindow if 0 < tabsInWindow.length - # If more than one tab remains and the current tab remains a conadidate, then pick another one. + # If more than one tab remains and the current tab is still a candidate, then don't pick the current + # tab (because jumping to it does nothing). tabs = (tab for tab in tabs when not tab.active) if 1 < tabs.length # Prefer shorter URLs. tabs.sort (a,b) -> a.url.length - b.url.length |
