Documentation: Fix referenes to erroneous lib.nvim.types.luaInline

This commit is contained in:
ky-bean 2025-09-08 21:38:28 -07:00
commit e4c8757752
No known key found for this signature in database
2 changed files with 3 additions and 3 deletions

View file

@ -43,7 +43,7 @@ with the following options:
| `enable` | `bool` | `true` | Enables or disables this autocommand definition. | `true` |
| `event` | `nullOr (listOf str)` | `null` | **Required.** List of Neovim events that trigger this autocommand (e.g., `BufWritePre`, `FileType`). | `[ "BufWritePre" ]` |
| `pattern` | `nullOr (listOf str)` | `null` | List of file patterns (globs) to match against (e.g., `*.py`, `*`). If `null`, matches all files for the given event. | `[ "*.lua", "*.nix" ]` |
| `callback` | `nullOr luaInline` | `null` | A Lua function to execute when the event triggers. Use `lib.nvim.types.luaInline` or `lib.options.literalExpression "mkLuaInline '''...'''"`. **Cannot be used with `command`.** | `lib.nvim.types.luaInline "function() print('File saved!') end"` |
| `callback` | `nullOr luaInline` | `null` | A Lua function to execute when the event triggers. Use `lib.generators.mkLuaInline`. **Cannot be used with `command`.** | `lib.generators.mkLuaInline "function() print('File saved!') end"` |
| `command` | `nullOr str` | `null` | A Vimscript command to execute when the event triggers. **Cannot be used with `callback`.** | `"echo 'File saved!'"` |
| `group` | `nullOr str` | `null` | The name of an `augroup` (defined in `vim.augroups`) to associate this autocommand with. | `"MyCustomAuGroup"` |
| `desc` | `nullOr str` | `null` | A description for the autocommand (useful for introspection). | `"Format buffer on save"` |
@ -71,7 +71,7 @@ Vimscript) for the same autocommand. Choose one.
pattern = [ "*.lua" ];
group = "UserSetup";
desc = "Notify after saving Lua file";
callback = lib.nvim.types.luaInline ''
callback = lib.generators.mkLuaInline ''
function()
vim.notify("Lua file saved!", vim.log.levels.INFO)
end

View file

@ -38,7 +38,7 @@
type = nullOr luaInline;
default = null;
example = literalExpression ''
mkLuaInline '''
lib.generators.mkLuaInline '''
function()
print("Saving a Lua file...")
end