From e4c8757752ec9737fbfcb84f8e85a770ee6a9bd3 Mon Sep 17 00:00:00 2001 From: ky-bean Date: Mon, 8 Sep 2025 21:38:28 -0700 Subject: [PATCH] Documentation: Fix referenes to erroneous `lib.nvim.types.luaInline` --- docs/manual/configuring/autocmds.md | 4 ++-- modules/neovim/init/autocmds.nix | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/manual/configuring/autocmds.md b/docs/manual/configuring/autocmds.md index be10e726..92df10f7 100644 --- a/docs/manual/configuring/autocmds.md +++ b/docs/manual/configuring/autocmds.md @@ -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 diff --git a/modules/neovim/init/autocmds.nix b/modules/neovim/init/autocmds.nix index 81580e6b..07656134 100644 --- a/modules/neovim/init/autocmds.nix +++ b/modules/neovim/init/autocmds.nix @@ -38,7 +38,7 @@ type = nullOr luaInline; default = null; example = literalExpression '' - mkLuaInline ''' + lib.generators.mkLuaInline ''' function() print("Saving a Lua file...") end