mirror of
				https://github.com/NotAShelf/nvf.git
				synced 2025-10-31 11:02:37 +00:00 
			
		
		
		
	Documentation: Fix referenes to erroneous lib.nvim.types.luaInline
		
	This commit is contained in:
		
					parent
					
						
							
								fb31022b36
							
						
					
				
			
			
				commit
				
					
						e4c8757752
					
				
			
		
					 2 changed files with 3 additions and 3 deletions
				
			
		|  | @ -43,7 +43,7 @@ with the following options: | ||||||
| | `enable`   | `bool`                | `true`  | Enables or disables this autocommand definition.                                                                                                                                 | `true`                                                           | | | `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" ]`                                              | | | `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" ]`                                           | | | `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!'"`                                           | | | `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"`                                              | | | `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"`                                        | | | `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" ]; |       pattern = [ "*.lua" ]; | ||||||
|       group = "UserSetup"; |       group = "UserSetup"; | ||||||
|       desc = "Notify after saving Lua file"; |       desc = "Notify after saving Lua file"; | ||||||
|       callback = lib.nvim.types.luaInline '' |       callback = lib.generators.mkLuaInline '' | ||||||
|         function() |         function() | ||||||
|           vim.notify("Lua file saved!", vim.log.levels.INFO) |           vim.notify("Lua file saved!", vim.log.levels.INFO) | ||||||
|         end |         end | ||||||
|  |  | ||||||
|  | @ -38,7 +38,7 @@ | ||||||
|         type = nullOr luaInline; |         type = nullOr luaInline; | ||||||
|         default = null; |         default = null; | ||||||
|         example = literalExpression '' |         example = literalExpression '' | ||||||
|           mkLuaInline ''' |           lib.generators.mkLuaInline ''' | ||||||
|             function() |             function() | ||||||
|                 print("Saving a Lua file...") |                 print("Saving a Lua file...") | ||||||
|             end |             end | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 ky-bean
				ky-bean