Merge branch 'tstmove' into develop

This commit is contained in:
Vsevolod Chernetskyi 2025-02-25 16:51:21 +02:00
commit 7e636e4ab0
2 changed files with 15 additions and 15 deletions

View file

@ -269,15 +269,15 @@ abstract class BufferCompletionSource extends Completions.CompletionSourceFuse {
/**
* Provide identifier, which will be used before tab title in the completion option.
* @param index of a tab calculated by Tridactyl
* @param index of the tab calculated by Tridactyl
* @param tab Tab
*/
protected abstract titlePrefix(index: number, tab: browser.tabs.Tab): number
/**
* Provide value, which will be used on tab completion (i.e. when user selects tab option using <Space> or <Enter>).
* @param index of a tab calculated by Tridactyl
* @param tab Tab
* @param titlePrefix identifier user before tab title
* @param isAlternative marker if completion value is for previous tab
*/
protected abstract completionValue(
titlePrefix: number,

View file

@ -3089,16 +3089,16 @@ export async function undo(item = "recent"): Promise<number> {
item === "recent"
? s => s.window || (s.tab && s.tab.windowId === current_win_id)
: item === "tab"
? s => s.tab
: item === "tab_strict"
? s => s.tab && s.tab.windowId === current_win_id
: item === "window"
? s => s.window
: !isNaN(parseInt(item, 10))
? s => (s.tab || s.window).sessionId === item
: () => {
throw new Error(`[undo] Invalid argument: ${item}. Must be one of "recent, "tab", "tab_strict", "window" or a sessionId (by selecting a session using the undo completion).`)
} // this won't throw an error if there isn't anything in the session list, but I don't think that matters
? s => s.tab
: item === "tab_strict"
? s => s.tab && s.tab.windowId === current_win_id
: item === "window"
? s => s.window
: !isNaN(parseInt(item, 10))
? s => (s.tab || s.window).sessionId === item
: () => {
throw new Error(`[undo] Invalid argument: ${item}. Must be one of "recent, "tab", "tab_strict", "window" or a sessionId (by selecting a session using the undo completion).`)
} // this won't throw an error if there isn't anything in the session list, but I don't think that matters
const session = sessions.find(predicate)
if (session) {
@ -6230,6 +6230,6 @@ export async function tstmoveafter(tabId: string) {
* Attach current tree as a child to the selected parent.
*/
//#background
export async function tstattach(tabId: string) {
treestyletab.attachTree(Number(tabId))
export async function tstattach(parentTabId: string) {
treestyletab.attachTree(Number(parentTabId))
}