mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 09:31:41 -05:00
commit
fc98519e80
2 changed files with 35 additions and 1 deletions
|
@ -68,7 +68,14 @@ export class BufferCompletionSource extends Completions.CompletionSourceFuse {
|
|||
|
||||
constructor(private _parent) {
|
||||
super(
|
||||
["tab", "tabclose", "tabdetach", "tabduplicate", "tabmove"],
|
||||
[
|
||||
"tab",
|
||||
"tabclose",
|
||||
"tabdetach",
|
||||
"tabduplicate",
|
||||
"tabmove",
|
||||
"tabrename",
|
||||
],
|
||||
"BufferCompletionSource",
|
||||
"Tabs",
|
||||
)
|
||||
|
@ -89,6 +96,8 @@ export class BufferCompletionSource extends Completions.CompletionSourceFuse {
|
|||
|
||||
async filter(exstr) {
|
||||
this.lastExstr = exstr
|
||||
const prefix = this.splitOnPrefix(exstr).shift()
|
||||
if (prefix === "tabrename ") this.shouldSetStateFromScore = false
|
||||
return this.onInput(exstr)
|
||||
}
|
||||
|
||||
|
|
|
@ -3524,6 +3524,31 @@ export async function taball(...id: string[]) {
|
|||
return tab_helper(true, true, ...id)
|
||||
}
|
||||
|
||||
/** Rename current tab.
|
||||
@hidden
|
||||
|
||||
@param name
|
||||
Tab name.
|
||||
*/
|
||||
//#content_helper
|
||||
export function tabcurrentrename(...name: string[]) {
|
||||
document.title = name.join(" ")
|
||||
}
|
||||
|
||||
/** Rename a tab.
|
||||
|
||||
@param index
|
||||
Index of the target tab.
|
||||
|
||||
@param name
|
||||
Tab name.
|
||||
*/
|
||||
//#background
|
||||
export async function tabrename(index: string, ...name: string[]) {
|
||||
const id = await idFromIndex(index)
|
||||
return Messaging.messageTab(id, "excmd_content", "tabcurrentrename", name)
|
||||
}
|
||||
|
||||
/** Helper to change active tab. Used by [[tab]] and [[taball]].
|
||||
|
||||
@param interactive
|
||||
|
|
Loading…
Add table
Reference in a new issue