Skip to content

Commit

Permalink
chore: docs for gen command update
Browse files Browse the repository at this point in the history
  • Loading branch information
mikesmithgh committed Nov 1, 2023
1 parent d9dc568 commit 4576b0a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -290,10 +290,10 @@ use ASCII instead, set the option `status_window.style_simple` to `true`.
## 🫡 Commands and Lua API
The API is available via the `kitty-scrollback.api` module. e.g., `require('kitty-scrollback.api')`

| Command | API | Description |
| :----------------------------------- | :------------------------------- | :---------------------------------------------------------------------- |
| `:KittyScrollbackGenerateKittens[!]` | `generate_kittens(boolean?)` | Generate Kitten commands used as reference for configuring `kitty.conf` |
| `:KittyScrollbackCheckHealth` | `checkhealth()` | Run `:checkhealth kitty-scrollback` in the context of Kitty |
| Command | API | Description |
| :---------------------------------------------------- | :--------------------------------------------------------------- | :---------------------------------------------------------------------- |
| `:KittyScrollbackGenerateKittens[!] [generate_modes]` | `generate_kittens(boolean?, table<string\|'commands'\|'maps'>)?` | Generate Kitten commands used as reference for configuring `kitty.conf` |
| `:KittyScrollbackCheckHealth` | `checkhealth()` | Run `:checkhealth kitty-scrollback` in the context of Kitty |

## ⌨️ Keymaps and Lua API
The API is available via the `kitty-scrollback.api` module. e.g., `require('kitty-scrollback.api')`
Expand Down
5 changes: 5 additions & 0 deletions lua/kitty-scrollback/api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,11 @@ M.toggle_footer = function()
end
end

---@alias KsbGenKittenModes string | 'maps' | 'commands'

---Generate Kitten commands used as reference for configuring `kitty.conf`
---@param all boolean|nil
---@param generate_modes table<KsbGenKittenModes>|nil
M.generate_kittens = function(all, generate_modes)
generate_modes = (generate_modes and next(generate_modes)) and generate_modes or { 'maps' }
local target_gen_modes = {}
Expand Down

0 comments on commit 4576b0a

Please sign in to comment.