From 37ba00af0e89641d0c54c19968c8986719eecde1 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Thu, 17 Sep 2015 10:23:58 +0100 Subject: Fix regression in #1828. In #1828, we (I) broke the fact that `gt` and `gT` should be able to wrap around at the ends (so, for example, `gt` on the right-most tab should take you to the first). --- background_scripts/main.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'background_scripts/main.coffee') diff --git a/background_scripts/main.coffee b/background_scripts/main.coffee index 511d24ac..df841028 100644 --- a/background_scripts/main.coffee +++ b/background_scripts/main.coffee @@ -349,9 +349,9 @@ selectTab = (direction, count = 1) -> toSelect = switch direction when "next" - Math.min tabs.length - 1, currentTab.index + count + (currentTab.index + count) % tabs.length when "previous" - Math.max 0, currentTab.index - count + (currentTab.index - count + count * tabs.length) % tabs.length when "first" Math.min tabs.length - 1, count - 1 when "last" -- cgit v1.2.3