mirror of
				https://github.com/neovim/neovim.git
				synced 2025-10-26 12:27:24 +00:00 
			
		
		
		
	docs(autocmd): generate events enum type #34883
This commit is contained in:
		| @@ -3799,7 +3799,8 @@ nvim_clear_autocmds({opts})                            *nvim_clear_autocmds()* | |||||||
|  |  | ||||||
|     Parameters: ~ |     Parameters: ~ | ||||||
|       • {opts}  (`vim.api.keyset.clear_autocmds`) Parameters |       • {opts}  (`vim.api.keyset.clear_autocmds`) Parameters | ||||||
|                 • event: (string|table) Examples: |                 • event: (vim.api.keyset.events|vim.api.keyset.events[]) | ||||||
|  |                   Examples: | ||||||
|                   • event: "pat1" |                   • event: "pat1" | ||||||
|                   • event: { "pat1" } |                   • event: { "pat1" } | ||||||
|                   • event: { "pat1", "pat2", "pat3" } |                   • event: { "pat1", "pat2", "pat3" } | ||||||
| @@ -3871,8 +3872,8 @@ nvim_create_autocmd({event}, {opts})                   *nvim_create_autocmd()* | |||||||
|         Since: 0.7.0 |         Since: 0.7.0 | ||||||
|  |  | ||||||
|     Parameters: ~ |     Parameters: ~ | ||||||
|       • {event}  (`any`) (string|array) Event(s) that will trigger the handler |       • {event}  (`vim.api.keyset.events|vim.api.keyset.events[]`) Event(s) | ||||||
|                  (`callback` or `command`). |                  that will trigger the handler (`callback` or `command`). | ||||||
|       • {opts}   (`vim.api.keyset.create_autocmd`) Options dict: |       • {opts}   (`vim.api.keyset.create_autocmd`) Options dict: | ||||||
|                  • group (string|integer) optional: autocommand group name or |                  • group (string|integer) optional: autocommand group name or | ||||||
|                    id to match against. |                    id to match against. | ||||||
| @@ -3890,8 +3891,8 @@ nvim_create_autocmd({event}, {opts})                   *nvim_create_autocmd()* | |||||||
|                    receives one argument, a table with these keys: |                    receives one argument, a table with these keys: | ||||||
|                                                                   *event-args* |                                                                   *event-args* | ||||||
|                    • id: (number) autocommand id |                    • id: (number) autocommand id | ||||||
|                    • event: (string) name of the triggered event |                    • event: (vim.api.keyset.events) name of the triggered | ||||||
|                      |autocmd-events| |                      event |autocmd-events| | ||||||
|                    • group: (number|nil) autocommand group id, if any |                    • group: (number|nil) autocommand group id, if any | ||||||
|                    • file: (string) <afile> (not expanded to a full path) |                    • file: (string) <afile> (not expanded to a full path) | ||||||
|                    • match: (string) <amatch> (expanded to a full path) |                    • match: (string) <amatch> (expanded to a full path) | ||||||
| @@ -3965,7 +3966,8 @@ nvim_exec_autocmds({event}, {opts})                     *nvim_exec_autocmds()* | |||||||
|         Since: 0.7.0 |         Since: 0.7.0 | ||||||
|  |  | ||||||
|     Parameters: ~ |     Parameters: ~ | ||||||
|       • {event}  (`any`) (String|Array) The event or events to execute |       • {event}  (`vim.api.keyset.events|vim.api.keyset.events[]`) The event | ||||||
|  |                  or events to execute | ||||||
|       • {opts}   (`vim.api.keyset.exec_autocmds`) Dict of autocommand options: |       • {opts}   (`vim.api.keyset.exec_autocmds`) Dict of autocommand options: | ||||||
|                  • group (string|integer) optional: the autocommand group name |                  • group (string|integer) optional: the autocommand group name | ||||||
|                    or id to match against. |autocmd-groups|. |                    or id to match against. |autocmd-groups|. | ||||||
| @@ -4010,8 +4012,8 @@ nvim_get_autocmds({opts})                                *nvim_get_autocmds()* | |||||||
|                 • buffer: (integer) Buffer number or list of buffer numbers |                 • buffer: (integer) Buffer number or list of buffer numbers | ||||||
|                   for buffer local autocommands |autocmd-buflocal|. Cannot be |                   for buffer local autocommands |autocmd-buflocal|. Cannot be | ||||||
|                   used with {pattern} |                   used with {pattern} | ||||||
|                 • event: (string|table) event or events to match against |                 • event: (vim.api.keyset.events|vim.api.keyset.events[]) event | ||||||
|                   |autocmd-events|. |                   or events to match against |autocmd-events|. | ||||||
|                 • id: (integer) Autocommand ID to match. |                 • id: (integer) Autocommand ID to match. | ||||||
|                 • group: (string|table) the autocommand group name or id to |                 • group: (string|table) the autocommand group name or id to | ||||||
|                   match against. |                   match against. | ||||||
| @@ -4029,7 +4031,7 @@ nvim_get_autocmds({opts})                                *nvim_get_autocmds()* | |||||||
|           script function which is executed when this autocommand is |           script function which is executed when this autocommand is | ||||||
|           triggered. |           triggered. | ||||||
|         • desc: (string) the autocommand description. |         • desc: (string) the autocommand description. | ||||||
|         • event: (string) the autocommand event. |         • event: (vim.api.keyset.events) the autocommand event. | ||||||
|         • id: (integer) the autocommand id (only when defined with the API). |         • id: (integer) the autocommand id (only when defined with the API). | ||||||
|         • group: (integer) the autocommand group id. |         • group: (integer) the autocommand group id. | ||||||
|         • group_name: (string) the autocommand group name. |         • group_name: (string) the autocommand group name. | ||||||
|   | |||||||
							
								
								
									
										13
									
								
								runtime/lua/vim/_meta/api.lua
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										13
									
								
								runtime/lua/vim/_meta/api.lua
									
									
									
										generated
									
									
									
								
							| @@ -830,7 +830,7 @@ function vim.api.nvim_chan_send(chan, data) end | |||||||
| --- Clears all autocommands selected by {opts}. To delete autocmds see `nvim_del_autocmd()`. | --- Clears all autocommands selected by {opts}. To delete autocmds see `nvim_del_autocmd()`. | ||||||
| --- | --- | ||||||
| --- @param opts vim.api.keyset.clear_autocmds Parameters | --- @param opts vim.api.keyset.clear_autocmds Parameters | ||||||
| --- - event: (string|table) | --- - event: (vim.api.keyset.events|vim.api.keyset.events[]) | ||||||
| ---      Examples: | ---      Examples: | ||||||
| ---      - event: "pat1" | ---      - event: "pat1" | ||||||
| ---      - event: { "pat1" } | ---      - event: { "pat1" } | ||||||
| @@ -939,7 +939,7 @@ function vim.api.nvim_create_augroup(name, opts) end | |||||||
| --- | --- | ||||||
| --- @see `:help autocommand` | --- @see `:help autocommand` | ||||||
| --- @see vim.api.nvim_del_autocmd | --- @see vim.api.nvim_del_autocmd | ||||||
| --- @param event any (string|array) Event(s) that will trigger the handler (`callback` or `command`). | --- @param event vim.api.keyset.events|vim.api.keyset.events[] Event(s) that will trigger the handler (`callback` or `command`). | ||||||
| --- @param opts vim.api.keyset.create_autocmd Options dict: | --- @param opts vim.api.keyset.create_autocmd Options dict: | ||||||
| --- - group (string|integer) optional: autocommand group name or id to match against. | --- - group (string|integer) optional: autocommand group name or id to match against. | ||||||
| --- - pattern (string|array) optional: pattern(s) to match literally `autocmd-pattern`. | --- - pattern (string|array) optional: pattern(s) to match literally `autocmd-pattern`. | ||||||
| @@ -951,7 +951,7 @@ function vim.api.nvim_create_augroup(name, opts) end | |||||||
| --- value (not `false` or `nil`) to delete the autocommand, and receives one argument, a | --- value (not `false` or `nil`) to delete the autocommand, and receives one argument, a | ||||||
| --- table with these keys: [event-args]() | --- table with these keys: [event-args]() | ||||||
| ---     - id: (number) autocommand id | ---     - id: (number) autocommand id | ||||||
| ---     - event: (string) name of the triggered event `autocmd-events` | ---     - event: (vim.api.keyset.events) name of the triggered event `autocmd-events` | ||||||
| ---     - group: (number|nil) autocommand group id, if any | ---     - group: (number|nil) autocommand group id, if any | ||||||
| ---     - file: (string) [<afile>] (not expanded to a full path) | ---     - file: (string) [<afile>] (not expanded to a full path) | ||||||
| ---     - match: (string) [<amatch>] (expanded to a full path) | ---     - match: (string) [<amatch>] (expanded to a full path) | ||||||
| @@ -1176,7 +1176,7 @@ function vim.api.nvim_exec2(src, opts) end | |||||||
| --- Execute all autocommands for {event} that match the corresponding | --- Execute all autocommands for {event} that match the corresponding | ||||||
| ---  {opts} `autocmd-execute`. | ---  {opts} `autocmd-execute`. | ||||||
| --- @see `:help :doautocmd` | --- @see `:help :doautocmd` | ||||||
| --- @param event any (String|Array) The event or events to execute | --- @param event vim.api.keyset.events|vim.api.keyset.events[] The event or events to execute | ||||||
| --- @param opts vim.api.keyset.exec_autocmds Dict of autocommand options: | --- @param opts vim.api.keyset.exec_autocmds Dict of autocommand options: | ||||||
| --- - group (string|integer) optional: the autocommand group name or | --- - group (string|integer) optional: the autocommand group name or | ||||||
| --- id to match against. `autocmd-groups`. | --- id to match against. `autocmd-groups`. | ||||||
| @@ -1249,7 +1249,8 @@ function vim.api.nvim_get_all_options_info() end | |||||||
| --- @param opts vim.api.keyset.get_autocmds Dict with at least one of the following: | --- @param opts vim.api.keyset.get_autocmds Dict with at least one of the following: | ||||||
| --- - buffer: (integer) Buffer number or list of buffer numbers for buffer local autocommands | --- - buffer: (integer) Buffer number or list of buffer numbers for buffer local autocommands | ||||||
| --- `autocmd-buflocal`. Cannot be used with {pattern} | --- `autocmd-buflocal`. Cannot be used with {pattern} | ||||||
| --- - event: (string|table) event or events to match against `autocmd-events`. | --- - event: (vim.api.keyset.events|vim.api.keyset.events[]) | ||||||
|  | ---   event or events to match against `autocmd-events`. | ||||||
| --- - id: (integer) Autocommand ID to match. | --- - id: (integer) Autocommand ID to match. | ||||||
| --- - group: (string|table) the autocommand group name or id to match against. | --- - group: (string|table) the autocommand group name or id to match against. | ||||||
| --- - pattern: (string|table) pattern or patterns to match against `autocmd-pattern`. | --- - pattern: (string|table) pattern or patterns to match against `autocmd-pattern`. | ||||||
| @@ -1262,7 +1263,7 @@ function vim.api.nvim_get_all_options_info() end | |||||||
| --- - callback: (function|string|nil): Lua function or name of a Vim script function | --- - callback: (function|string|nil): Lua function or name of a Vim script function | ||||||
| ---   which is executed when this autocommand is triggered. | ---   which is executed when this autocommand is triggered. | ||||||
| --- - desc: (string) the autocommand description. | --- - desc: (string) the autocommand description. | ||||||
| --- - event: (string) the autocommand event. | --- - event: (vim.api.keyset.events) the autocommand event. | ||||||
| --- - id: (integer) the autocommand id (only when defined with the API). | --- - id: (integer) the autocommand id (only when defined with the API). | ||||||
| --- - group: (integer) the autocommand group id. | --- - group: (integer) the autocommand group id. | ||||||
| --- - group_name: (string) the autocommand group name. | --- - group_name: (string) the autocommand group name. | ||||||
|   | |||||||
							
								
								
									
										146
									
								
								runtime/lua/vim/_meta/api_keysets.lua
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										146
									
								
								runtime/lua/vim/_meta/api_keysets.lua
									
									
									
										generated
									
									
									
								
							| @@ -18,7 +18,7 @@ error('Cannot require a meta file') | |||||||
|  |  | ||||||
| --- @class vim.api.keyset.clear_autocmds | --- @class vim.api.keyset.clear_autocmds | ||||||
| --- @field buffer? integer | --- @field buffer? integer | ||||||
| --- @field event? string|string[] | --- @field event? vim.api.keyset.events|vim.api.keyset.events[] | ||||||
| --- @field group? integer|string | --- @field group? integer|string | ||||||
| --- @field pattern? string|string[] | --- @field pattern? string|string[] | ||||||
|  |  | ||||||
| @@ -77,6 +77,148 @@ error('Cannot require a meta file') | |||||||
| --- @class vim.api.keyset.create_augroup | --- @class vim.api.keyset.create_augroup | ||||||
| --- @field clear? boolean | --- @field clear? boolean | ||||||
|  |  | ||||||
|  | --- @alias vim.api.keyset.events | ||||||
|  | --- |'BufAdd' | ||||||
|  | --- |'BufCreate' | ||||||
|  | --- |'BufDelete' | ||||||
|  | --- |'BufEnter' | ||||||
|  | --- |'BufFilePost' | ||||||
|  | --- |'BufFilePre' | ||||||
|  | --- |'BufHidden' | ||||||
|  | --- |'BufLeave' | ||||||
|  | --- |'BufModifiedSet' | ||||||
|  | --- |'BufNew' | ||||||
|  | --- |'BufNewFile' | ||||||
|  | --- |'BufRead' | ||||||
|  | --- |'BufReadCmd' | ||||||
|  | --- |'BufReadPost' | ||||||
|  | --- |'BufReadPre' | ||||||
|  | --- |'BufUnload' | ||||||
|  | --- |'BufWinEnter' | ||||||
|  | --- |'BufWinLeave' | ||||||
|  | --- |'BufWipeout' | ||||||
|  | --- |'BufWrite' | ||||||
|  | --- |'BufWriteCmd' | ||||||
|  | --- |'BufWritePost' | ||||||
|  | --- |'BufWritePre' | ||||||
|  | --- |'ChanInfo' | ||||||
|  | --- |'ChanOpen' | ||||||
|  | --- |'CmdUndefined' | ||||||
|  | --- |'CmdlineChanged' | ||||||
|  | --- |'CmdlineEnter' | ||||||
|  | --- |'CmdlineLeave' | ||||||
|  | --- |'CmdlineLeavePre' | ||||||
|  | --- |'CmdwinEnter' | ||||||
|  | --- |'CmdwinLeave' | ||||||
|  | --- |'ColorScheme' | ||||||
|  | --- |'ColorSchemePre' | ||||||
|  | --- |'CompleteChanged' | ||||||
|  | --- |'CompleteDone' | ||||||
|  | --- |'CompleteDonePre' | ||||||
|  | --- |'CursorHold' | ||||||
|  | --- |'CursorHoldI' | ||||||
|  | --- |'CursorMoved' | ||||||
|  | --- |'CursorMovedC' | ||||||
|  | --- |'CursorMovedI' | ||||||
|  | --- |'DiagnosticChanged' | ||||||
|  | --- |'DiffUpdated' | ||||||
|  | --- |'DirChanged' | ||||||
|  | --- |'DirChangedPre' | ||||||
|  | --- |'EncodingChanged' | ||||||
|  | --- |'ExitPre' | ||||||
|  | --- |'FileAppendCmd' | ||||||
|  | --- |'FileAppendPost' | ||||||
|  | --- |'FileAppendPre' | ||||||
|  | --- |'FileChangedRO' | ||||||
|  | --- |'FileChangedShell' | ||||||
|  | --- |'FileChangedShellPost' | ||||||
|  | --- |'FileEncoding' | ||||||
|  | --- |'FileReadCmd' | ||||||
|  | --- |'FileReadPost' | ||||||
|  | --- |'FileReadPre' | ||||||
|  | --- |'FileType' | ||||||
|  | --- |'FileWriteCmd' | ||||||
|  | --- |'FileWritePost' | ||||||
|  | --- |'FileWritePre' | ||||||
|  | --- |'FilterReadPost' | ||||||
|  | --- |'FilterReadPre' | ||||||
|  | --- |'FilterWritePost' | ||||||
|  | --- |'FilterWritePre' | ||||||
|  | --- |'FocusGained' | ||||||
|  | --- |'FocusLost' | ||||||
|  | --- |'FuncUndefined' | ||||||
|  | --- |'GUIEnter' | ||||||
|  | --- |'GUIFailed' | ||||||
|  | --- |'InsertChange' | ||||||
|  | --- |'InsertCharPre' | ||||||
|  | --- |'InsertEnter' | ||||||
|  | --- |'InsertLeave' | ||||||
|  | --- |'InsertLeavePre' | ||||||
|  | --- |'LspAttach' | ||||||
|  | --- |'LspDetach' | ||||||
|  | --- |'LspNotify' | ||||||
|  | --- |'LspProgress' | ||||||
|  | --- |'LspRequest' | ||||||
|  | --- |'LspTokenUpdate' | ||||||
|  | --- |'MenuPopup' | ||||||
|  | --- |'ModeChanged' | ||||||
|  | --- |'OptionSet' | ||||||
|  | --- |'PackChanged' | ||||||
|  | --- |'PackChangedPre' | ||||||
|  | --- |'QuickFixCmdPost' | ||||||
|  | --- |'QuickFixCmdPre' | ||||||
|  | --- |'QuitPre' | ||||||
|  | --- |'RecordingEnter' | ||||||
|  | --- |'RecordingLeave' | ||||||
|  | --- |'RemoteReply' | ||||||
|  | --- |'SafeState' | ||||||
|  | --- |'SearchWrapped' | ||||||
|  | --- |'SessionLoadPost' | ||||||
|  | --- |'SessionWritePost' | ||||||
|  | --- |'ShellCmdPost' | ||||||
|  | --- |'ShellFilterPost' | ||||||
|  | --- |'Signal' | ||||||
|  | --- |'SourceCmd' | ||||||
|  | --- |'SourcePost' | ||||||
|  | --- |'SourcePre' | ||||||
|  | --- |'SpellFileMissing' | ||||||
|  | --- |'StdinReadPost' | ||||||
|  | --- |'StdinReadPre' | ||||||
|  | --- |'SwapExists' | ||||||
|  | --- |'Syntax' | ||||||
|  | --- |'TabClosed' | ||||||
|  | --- |'TabEnter' | ||||||
|  | --- |'TabLeave' | ||||||
|  | --- |'TabNew' | ||||||
|  | --- |'TabNewEntered' | ||||||
|  | --- |'TermChanged' | ||||||
|  | --- |'TermClose' | ||||||
|  | --- |'TermEnter' | ||||||
|  | --- |'TermLeave' | ||||||
|  | --- |'TermOpen' | ||||||
|  | --- |'TermRequest' | ||||||
|  | --- |'TermResponse' | ||||||
|  | --- |'TextChanged' | ||||||
|  | --- |'TextChangedI' | ||||||
|  | --- |'TextChangedP' | ||||||
|  | --- |'TextChangedT' | ||||||
|  | --- |'TextYankPost' | ||||||
|  | --- |'UIEnter' | ||||||
|  | --- |'UILeave' | ||||||
|  | --- |'User' | ||||||
|  | --- |'VimEnter' | ||||||
|  | --- |'VimLeave' | ||||||
|  | --- |'VimLeavePre' | ||||||
|  | --- |'VimResized' | ||||||
|  | --- |'VimResume' | ||||||
|  | --- |'VimSuspend' | ||||||
|  | --- |'WinClosed' | ||||||
|  | --- |'WinEnter' | ||||||
|  | --- |'WinLeave' | ||||||
|  | --- |'WinNew' | ||||||
|  | --- |'WinResized' | ||||||
|  | --- |'WinScrolled' | ||||||
|  |  | ||||||
| --- @class vim.api.keyset.create_autocmd | --- @class vim.api.keyset.create_autocmd | ||||||
| --- @field buffer? integer | --- @field buffer? integer | ||||||
| --- @field callback? string|fun(args: vim.api.keyset.create_autocmd.callback_args): boolean? | --- @field callback? string|fun(args: vim.api.keyset.create_autocmd.callback_args): boolean? | ||||||
| @@ -114,7 +256,7 @@ error('Cannot require a meta file') | |||||||
| --- @field output? boolean | --- @field output? boolean | ||||||
|  |  | ||||||
| --- @class vim.api.keyset.get_autocmds | --- @class vim.api.keyset.get_autocmds | ||||||
| --- @field event? string|string[] | --- @field event? vim.api.keyset.events|vim.api.keyset.events[] | ||||||
| --- @field group? integer|string | --- @field group? integer|string | ||||||
| --- @field pattern? string|string[] | --- @field pattern? string|string[] | ||||||
| --- @field buffer? integer|integer[] | --- @field buffer? integer|integer[] | ||||||
|   | |||||||
| @@ -141,8 +141,12 @@ local function process_proto(item, state) | |||||||
|   cur_obj.params = cur_obj.params or {} |   cur_obj.params = cur_obj.params or {} | ||||||
|  |  | ||||||
|   for _, p in ipairs(item.parameters) do |   for _, p in ipairs(item.parameters) do | ||||||
|     local param = { name = p[2], type = api_type(p[1]) } |     local event_type = 'vim.api.keyset.events|vim.api.keyset.events[]' | ||||||
|  |     local event = (item.name == 'nvim_create_autocmd' or item.name == 'nvim_exec_autocmds') | ||||||
|  |       and p[2] == 'event' | ||||||
|  |     local param = { name = p[2], type = event and event_type or api_type(p[1]) } | ||||||
|     local added = false |     local added = false | ||||||
|  |  | ||||||
|     for _, cp in ipairs(cur_obj.params) do |     for _, cp in ipairs(cur_obj.params) do | ||||||
|       if cp.name == param.name then |       if cp.name == param.name then | ||||||
|         cp.type = param.type |         cp.type = param.type | ||||||
|   | |||||||
| @@ -322,12 +322,16 @@ local function get_api_keysets_meta() | |||||||
|  |  | ||||||
|   --- @type {name: string, keys: string[], types: table<string,string>}[] |   --- @type {name: string, keys: string[], types: table<string,string>}[] | ||||||
|   local keysets = metadata.keysets |   local keysets = metadata.keysets | ||||||
|  |   local event_type = 'vim.api.keyset.events|vim.api.keyset.events[]' | ||||||
|  |  | ||||||
|   for _, k in ipairs(keysets) do |   for _, k in ipairs(keysets) do | ||||||
|     local params = {} |     local params = {} | ||||||
|     for _, key in ipairs(k.keys) do |     for _, key in ipairs(k.keys) do | ||||||
|       local pty = k.types[key] or 'any' |       local pty = k.types[key] or 'any' | ||||||
|       table.insert(params, { key .. '?', api_type(pty) }) |       table.insert(params, { | ||||||
|  |         key .. '?', | ||||||
|  |         k.name:find('autocmd') and key == 'event' and event_type or api_type(pty), | ||||||
|  |       }) | ||||||
|     end |     end | ||||||
|     ret[k.name] = { |     ret[k.name] = { | ||||||
|       signature = 'NA', |       signature = 'NA', | ||||||
| @@ -346,6 +350,16 @@ end | |||||||
| local function render_api_keyset_meta(_f, fun, write) | local function render_api_keyset_meta(_f, fun, write) | ||||||
|   if string.sub(fun.name, 1, 1) == '_' then |   if string.sub(fun.name, 1, 1) == '_' then | ||||||
|     return -- not exported |     return -- not exported | ||||||
|  |   elseif fun.name == 'create_autocmd' then | ||||||
|  |     local events = vim.deepcopy(require('nvim.auevents')) | ||||||
|  |     for event in pairs(events.aliases) do | ||||||
|  |       events.events[event] = true | ||||||
|  |     end | ||||||
|  |     write('') | ||||||
|  |     write('--- @alias vim.api.keyset.events') | ||||||
|  |     for event in vim.spairs(events.events) do | ||||||
|  |       write(("--- |'%s'"):format(event)) | ||||||
|  |     end | ||||||
|   end |   end | ||||||
|   write('') |   write('') | ||||||
|   write('--- @class vim.api.keyset.' .. fun.name) |   write('--- @class vim.api.keyset.' .. fun.name) | ||||||
|   | |||||||
| @@ -70,7 +70,8 @@ static int64_t next_autocmd_id = 1; | |||||||
| /// @param opts Dict with at least one of the following: | /// @param opts Dict with at least one of the following: | ||||||
| ///             - buffer: (integer) Buffer number or list of buffer numbers for buffer local autocommands | ///             - buffer: (integer) Buffer number or list of buffer numbers for buffer local autocommands | ||||||
| ///             |autocmd-buflocal|. Cannot be used with {pattern} | ///             |autocmd-buflocal|. Cannot be used with {pattern} | ||||||
| ///             - event: (string|table) event or events to match against |autocmd-events|. | ///             - event: (vim.api.keyset.events|vim.api.keyset.events[]) | ||||||
|  | ///               event or events to match against |autocmd-events|. | ||||||
| ///             - id: (integer) Autocommand ID to match. | ///             - id: (integer) Autocommand ID to match. | ||||||
| ///             - group: (string|table) the autocommand group name or id to match against. | ///             - group: (string|table) the autocommand group name or id to match against. | ||||||
| ///             - pattern: (string|table) pattern or patterns to match against |autocmd-pattern|. | ///             - pattern: (string|table) pattern or patterns to match against |autocmd-pattern|. | ||||||
| @@ -83,7 +84,7 @@ static int64_t next_autocmd_id = 1; | |||||||
| ///             - callback: (function|string|nil): Lua function or name of a Vim script function | ///             - callback: (function|string|nil): Lua function or name of a Vim script function | ||||||
| ///               which is executed when this autocommand is triggered. | ///               which is executed when this autocommand is triggered. | ||||||
| ///             - desc: (string) the autocommand description. | ///             - desc: (string) the autocommand description. | ||||||
| ///             - event: (string) the autocommand event. | ///             - event: (vim.api.keyset.events) the autocommand event. | ||||||
| ///             - id: (integer) the autocommand id (only when defined with the API). | ///             - id: (integer) the autocommand id (only when defined with the API). | ||||||
| ///             - group: (integer) the autocommand group id. | ///             - group: (integer) the autocommand group id. | ||||||
| ///             - group_name: (string) the autocommand group name. | ///             - group_name: (string) the autocommand group name. | ||||||
| @@ -361,7 +362,7 @@ cleanup: | |||||||
| /// pattern = vim.fn.expand('~') .. '/some/path/*.py' | /// pattern = vim.fn.expand('~') .. '/some/path/*.py' | ||||||
| /// ``` | /// ``` | ||||||
| /// | /// | ||||||
| /// @param event (string|array) Event(s) that will trigger the handler (`callback` or `command`). | /// @param event Event(s) that will trigger the handler (`callback` or `command`). | ||||||
| /// @param opts Options dict: | /// @param opts Options dict: | ||||||
| ///             - group (string|integer) optional: autocommand group name or id to match against. | ///             - group (string|integer) optional: autocommand group name or id to match against. | ||||||
| ///             - pattern (string|array) optional: pattern(s) to match literally |autocmd-pattern|. | ///             - pattern (string|array) optional: pattern(s) to match literally |autocmd-pattern|. | ||||||
| @@ -373,7 +374,7 @@ cleanup: | |||||||
| ///             value (not `false` or `nil`) to delete the autocommand, and receives one argument, a | ///             value (not `false` or `nil`) to delete the autocommand, and receives one argument, a | ||||||
| ///             table with these keys: [event-args]() | ///             table with these keys: [event-args]() | ||||||
| ///                 - id: (number) autocommand id | ///                 - id: (number) autocommand id | ||||||
| ///                 - event: (string) name of the triggered event |autocmd-events| | ///                 - event: (vim.api.keyset.events) name of the triggered event |autocmd-events| | ||||||
| ///                 - group: (number|nil) autocommand group id, if any | ///                 - group: (number|nil) autocommand group id, if any | ||||||
| ///                 - file: (string) [<afile>] (not expanded to a full path) | ///                 - file: (string) [<afile>] (not expanded to a full path) | ||||||
| ///                 - match: (string) [<amatch>] (expanded to a full path) | ///                 - match: (string) [<amatch>] (expanded to a full path) | ||||||
| @@ -523,7 +524,7 @@ void nvim_del_autocmd(Integer id, Error *err) | |||||||
| /// Clears all autocommands selected by {opts}. To delete autocmds see |nvim_del_autocmd()|. | /// Clears all autocommands selected by {opts}. To delete autocmds see |nvim_del_autocmd()|. | ||||||
| /// | /// | ||||||
| /// @param opts Parameters | /// @param opts Parameters | ||||||
| ///         - event: (string|table) | ///         - event: (vim.api.keyset.events|vim.api.keyset.events[]) | ||||||
| ///              Examples: | ///              Examples: | ||||||
| ///              - event: "pat1" | ///              - event: "pat1" | ||||||
| ///              - event: { "pat1" } | ///              - event: { "pat1" } | ||||||
| @@ -674,7 +675,7 @@ void nvim_del_augroup_by_name(String name, Error *err) | |||||||
|  |  | ||||||
| /// Execute all autocommands for {event} that match the corresponding | /// Execute all autocommands for {event} that match the corresponding | ||||||
| ///  {opts} |autocmd-execute|. | ///  {opts} |autocmd-execute|. | ||||||
| /// @param event (String|Array) The event or events to execute | /// @param event The event or events to execute | ||||||
| /// @param opts Dict of autocommand options: | /// @param opts Dict of autocommand options: | ||||||
| ///             - group (string|integer) optional: the autocommand group name or | ///             - group (string|integer) optional: the autocommand group name or | ||||||
| ///             id to match against. |autocmd-groups|. | ///             id to match against. |autocmd-groups|. | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 luukvbaal
					luukvbaal