Significant refactor of command, slashcommand and config handling, removal of "shortcuts"

This commit is contained in:
Zef Hemel
2025-06-16 17:08:04 +02:00
parent 0ab61b3689
commit 10f6efe0ad
43 changed files with 645 additions and 735 deletions
+1 -25
View File
@@ -1,25 +1 @@
APIs related to editor commands
### command.define(commandDef)
Registers a command.
Available keys:
* `name`: Name of the command
* `run`: Callback function
* `contexts`: AST node context in which this command should be available
* `priority`: Command priority (how high it appears in the list)
* `key`: Windows/Linux key binding (and mac, if not separately defined)
* `mac`: Mac-specific key binding
* `hide`: Hide this command from the [[Command Palette]]
* `requireMode`: `rw` or `ro` — only enable this command in a particular mode (read-write, or read-only)
Example:
```lua
command.define {
name = "My custom command",
run = function()
editor.flashNotification "Triggered my custom command"
end
}
```
See [[^Library/Std/Command]]