The palette's first row hands what the user typed to a plugin: a
calculator ("3.5 GB in MB"), a library or history search, jump to a time,
an assistant that runs commands for a sentence. There is one lead in the
player, and only a built-in plugin can hold it.
Example: Answer typed time stamps from the palette
The palette's first row reads "Go to: 12:30"; Enter seeks there. lead
puts the row up; the player sends the typed text with Enter, and the
plugin ends the request with done.
// Put up the row once, in activate: the player keeps it while stopped. constlead = plugin.palette.lead({ title:"Go to", icon:"search" }); lead.onRun(async ({ query, ticket }) => { const [minutes = 0, seconds = 0] = query.split(":").map(Number); // "12:30" awaitplugin.player.seek(minutes * 60 + seconds); awaitlead.done(ticket); // this request needs no command runs });
Put up the palette's lead row. Built-in plugins only.
The player keeps the row while the plugin is stopped and starts the
plugin for a run, so call it in activate. Disposing the handle (or
its scope) removes the row.
plugin.palette: the command palette's lead row.Remarks
The palette's first row hands what the user typed to a plugin: a calculator ("3.5 GB in MB"), a library or history search, jump to a time, an assistant that runs commands for a sentence. There is one lead in the player, and only a built-in plugin can hold it.
Example: Answer typed time stamps from the palette
The palette's first row reads "Go to: 12:30"; Enter seeks there.
leadputs the row up; the player sends the typed text with Enter, and the plugin ends the request withdone.Player
0.7.6
Since
1.7.9