mirror of
https://github.com/tridactyl/tridactyl.git
synced 2026-09-10 07:16:33 -04:00
Merge 5fa0590529 into ef99ffb858
This commit is contained in:
commit
2c9fd3fb94
|
|
@ -2819,6 +2819,20 @@ export async function tabprev(...args: string[]) {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Switch to the previously used tab, ignoring any tabs used within the last 10 seconds. Handy for flicking through previous tabs.
|
||||||
|
*/
|
||||||
|
//#background
|
||||||
|
export async function tabnextmru() {
|
||||||
|
return browser.tabs.query({ currentWindow: true, hidden: false }).then(tabs => {
|
||||||
|
tabs.sort((a, b) => b.lastAccessed - a.lastAccessed)
|
||||||
|
console.log(tabs)
|
||||||
|
const mru_ish = tabs.findIndex(t => Date.now() - t.lastAccessed - 10000 > 0)
|
||||||
|
console.log(mru_ish)
|
||||||
|
return browser.tabs.update(tabs[(mru_ish > -1 ? mru_ish : 1)].id, { active: true })
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Pushes the current tab to another window. Only works for windows of the same type
|
* Pushes the current tab to another window. Only works for windows of the same type
|
||||||
* (can't push a non-private tab to a private window or a private tab to
|
* (can't push a non-private tab to a private window or a private tab to
|
||||||
|
|
|
||||||
|
|
@ -478,6 +478,7 @@ export class default_config {
|
||||||
browsermaps = {
|
browsermaps = {
|
||||||
"<C-,>": "escapehatch",
|
"<C-,>": "escapehatch",
|
||||||
"<C-6>": "tab #",
|
"<C-6>": "tab #",
|
||||||
|
"<C-7>": "tabnextmru",
|
||||||
// "<CS-6>": "tab #", // banned by e2e tests
|
// "<CS-6>": "tab #", // banned by e2e tests
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,10 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"command_4": {
|
"command_4": {
|
||||||
|
"suggested_key": {
|
||||||
|
"default": "MacCtrl+7",
|
||||||
|
"windows": "Alt+7"
|
||||||
|
},
|
||||||
"description": "Internal use. See `:help bind`. Use `:bind --mode=browser` to change - do not change here."
|
"description": "Internal use. See `:help bind`. Use `:bind --mode=browser` to change - do not change here."
|
||||||
},
|
},
|
||||||
"command_5": {
|
"command_5": {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue