feat: add config.leader and document it#40
Conversation
Config.leader was missing, I added it, and used the preexisting `KeyNoAction` and documented both leader and the fields 'keys' and mods'
| -- recognized. Other keypresses will be swallowed and NOT passed through to the terminal. | ||
| -- | ||
| -- LEADER stays active until a keypress is registered (whether it matches a key binding or not), or | ||
| -- until it has been active for the duration specified by timeout_milliseconds, at which point it |
There was a problem hiding this comment.
Is it possible you could enclose timeout_milliseconds (and any other explicit identifier) ?
e.g. timeout_milliseconds
See Annotation Formatting in LuaLS' anotations wiki. It supports Markdown
A small example of how it should look when hovering:
There was a problem hiding this comment.
I typically do, I knew I was going to miss some!
There was a problem hiding this comment.
We all miss something eventually, don't worry
|
|
||
| -- You can also combine modifiers using the `|` symbol, like `"CMD|CTRL"`. | ||
| -- | ||
| ---@field mods? string Optional modifiers keys. |
There was a problem hiding this comment.
Could you delete the inline comment for this (and any other) ---@field key? I'm trying to get rid of these for better manipulation.
For instance:
---@field mods? string Optional modifiers keys.
--BECOMES:
-- Optional modifiers keys
---@field mods? stringIf you want to make that specific description stand out, I recommend you used tree - chars:
-- You can also combine modifiers using the `|` symbol, like `"CMD|CTRL"`.
-- ---
-- Optional modifiers keys
---@field mods? stringSee #42 for my rationale, I'd love to hear yours
There was a problem hiding this comment.
@craigmac I've edited the suggestion, missed the description on top of the ---@field annotation 💀
|
|
||
| ---@class LeaderKey: KeyNoAction | ||
| ---@field timeout_milliseconds? integer | ||
| ---@field timeout_milliseconds? integer Maximum time to wait for next key, default is 1000 ms. |
There was a problem hiding this comment.
You can reject it, but I'd suggest:
---@class LeaderKey: KeyNoAction
-- Maximum time to wait for the next key, in milliseconds.
--
-- The default is `1000`
---@field timeout_milliseconds? integer
--...See #42 for my rationale, I'd love to hear yours

Config.leader was missing, I added it, and used the preexisting
KeyNoActionand documented both leader and the fields 'keys' and mods'