From 053a6f094811f30b8bc24e05cb8bde3bdc8e8d06 Mon Sep 17 00:00:00 2001 From: Shin'ya Ueoka Date: Tue, 10 Oct 2017 21:24:57 +0900 Subject: fix tab selection --- src/background/tabs.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/background/tabs.js') diff --git a/src/background/tabs.js b/src/background/tabs.js index 32f71ba..166af4d 100644 --- a/src/background/tabs.js +++ b/src/background/tabs.js @@ -62,7 +62,7 @@ const selectPrevTab = (current, count) => { if (tabs.length < 2) { return; } - let select = (current - count) % tabs.length; + let select = (current - count + tabs.length) % tabs.length; let id = tabs[select].id; return browser.tabs.update(id, { active: true }); }); @@ -73,7 +73,7 @@ const selectNextTab = (current, count) => { if (tabs.length < 2) { return; } - let select = (current + count + tabs.length) % tabs.length; + let select = (current + count) % tabs.length; let id = tabs[select].id; return browser.tabs.update(id, { active: true }); }); -- cgit v1.2.3