excmds.ts: Make tabprev synchronous

This fixes https://github.com/cmcaine/tridactyl/issues/783.
This commit is contained in:
glacambre 2018-07-10 19:35:21 +02:00
parent 64a494adb8
commit c2d5f27394
No known key found for this signature in database
GPG key ID: B9625DB1767553AC

View file

@ -536,7 +536,7 @@ export function forceURI(maybeURI: string): string {
/** @hidden */
//#background_helper
function tabSetActive(id: number) {
browser.tabs.update(id, { active: true })
return browser.tabs.update(id, { active: true })
}
// }}}
@ -1451,7 +1451,7 @@ export function focusbyid(id: string) {
/** @hidden */
//#background_helper
async function tabIndexSetActive(index: number | string) {
tabSetActive(await idFromIndex(index))
return tabSetActive(await idFromIndex(index))
}
/** Switch to the next tab, wrapping round.
@ -1485,7 +1485,7 @@ export async function tabnext_gt(index?: number) {
*/
//#background
export async function tabprev(increment = 1) {
tabIndexSetActive((await activeTab()).index - increment + 1)
return tabIndexSetActive((await activeTab()).index - increment + 1)
}
/** Switch to the first tab. */