plugins/toggleterm: fix openMapping and documentation bug

This commit is contained in:
Gaetan Lepage 2023-06-22 10:45:20 +02:00 committed by Gaétan Lepage
parent 0c0c3b2d9d
commit 1a8bd3bdc1
2 changed files with 7 additions and 6 deletions

View file

@ -34,7 +34,7 @@ in {
``` ```
''; '';
openMapping = helpers.defaultNullOpts.mkStr "[[<c-\\>]]" "Setting the open_mapping key to use for toggling the terminal(s) will set up mappings for normal mode."; openMapping = helpers.defaultNullOpts.mkStr "<c-\\>" "Setting the open_mapping key to use for toggling the terminal(s) will set up mappings for normal mode.";
onCreate = helpers.mkNullOrOption types.str "Function to run when the terminal is first created."; onCreate = helpers.mkNullOrOption types.str "Function to run when the terminal is first created.";
@ -55,9 +55,10 @@ in {
autochdir = helpers.defaultNullOpts.mkBool false "When neovim changes it current directory the terminal will change it's own when next it's opened."; autochdir = helpers.defaultNullOpts.mkBool false "When neovim changes it current directory the terminal will change it's own when next it's opened.";
highlights = helpers.defaultNullOpts.mkNullable (with types; (attrsOf (attrsOf str))) "{}" '' highlights = helpers.defaultNullOpts.mkNullable (with types; (attrsOf (attrsOf str))) "{}" ''
Highlights which map to a highlight group name and a table of it's values. Highlights which map to a highlight group name and a table of it's values.
Example:
``` Example:
```
highlights = { highlights = {
Normal = { Normal = {
guibg = "<VALUE-HERE>"; guibg = "<VALUE-HERE>";
@ -134,7 +135,7 @@ in {
then size then size
else helpers.mkRaw size else helpers.mkRaw size
); );
open_mapping = helpers.ifNonNull' openMapping (helpers.mkRaw openMapping); open_mapping = helpers.ifNonNull' openMapping (helpers.mkRaw "[[${openMapping}]]");
on_create = helpers.ifNonNull' onCreate (helpers.mkRaw onCreate); on_create = helpers.ifNonNull' onCreate (helpers.mkRaw onCreate);
on_open = helpers.ifNonNull' onOpen (helpers.mkRaw onOpen); on_open = helpers.ifNonNull' onOpen (helpers.mkRaw onOpen);
on_close = helpers.ifNonNull' onClose (helpers.mkRaw onClose); on_close = helpers.ifNonNull' onClose (helpers.mkRaw onClose);

View file

@ -16,7 +16,7 @@
end end
end end
''; '';
openMapping = "[[<c-\\>]]"; openMapping = "<c-\\>";
onCreate = "function() end"; onCreate = "function() end";
onOpen = "function() end"; onOpen = "function() end";
onClose = "function() end"; onClose = "function() end";