Skip to content

Instantly share code, notes, and snippets.

@johnlindquist
Created December 16, 2023 16:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnlindquist/07f97cd383b1a81f1fb0e76507b81eb2 to your computer and use it in GitHub Desktop.
Save johnlindquist/07f97cd383b1a81f1fb0e76507b81eb2 to your computer and use it in GitHub Desktop.
// Name: Shortcuts Condition
import "@johnlindquist/kit"
let value = await arg(
{
placeholder: `Type "one`,
shortcuts: [
{
name: "one",
key: `${cmd}+1`,
condition: choice => {
return choice?.value === "One"
},
onPress: async () => {
submit("You win!")
},
visible: true,
bar: "right",
},
],
},
["One", "Two", "Three"]
)
await editor(value)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment