mirror of
https://github.com/neovim/neovim.git
synced 2025-12-15 19:05:40 +00:00
feat(keysets): teach Union and LuaRefOf
This commit is contained in:
committed by
Lewis Russell
parent
99e7323aa3
commit
8d55cc218c
2
runtime/lua/vim/_meta/api.lua
generated
2
runtime/lua/vim/_meta/api.lua
generated
@@ -1012,7 +1012,7 @@ function vim.api.nvim_create_namespace(name) end
|
||||
--- ```
|
||||
---
|
||||
--- @param name string Name of the new user command. Must begin with an uppercase letter.
|
||||
--- @param command any Replacement command to execute when this user command is executed. When called
|
||||
--- @param command string|fun(args: vim.api.keyset.create_user_command.command_args) Replacement command to execute when this user command is executed. When called
|
||||
--- from Lua, the command can also be a Lua function. The function is called with a
|
||||
--- single table argument that contains the following keys:
|
||||
--- - name: (string) Command name
|
||||
|
||||
100
runtime/lua/vim/_meta/api_keysets.lua
generated
100
runtime/lua/vim/_meta/api_keysets.lua
generated
@@ -4,11 +4,11 @@
|
||||
error('Cannot require a meta file')
|
||||
|
||||
--- @class vim.api.keyset.buf_attach
|
||||
--- @field on_lines? function
|
||||
--- @field on_bytes? function
|
||||
--- @field on_changedtick? function
|
||||
--- @field on_detach? function
|
||||
--- @field on_reload? function
|
||||
--- @field on_lines? fun(_: "lines", bufnr: integer, changedtick: integer, first: integer, last_old: integer, last_new: integer, byte_count: integer, deleted_codepoints?: integer, deleted_codeunits?: integer): boolean?
|
||||
--- @field on_bytes? fun(_: "bytes", bufnr: integer, changedtick: integer, start_row: integer, start_col: integer, start_byte: integer, old_end_row: integer, old_end_col: integer, old_end_byte: integer, new_end_row: integer, new_end_col: integer, new_end_byte: integer): boolean?
|
||||
--- @field on_changedtick? fun(_: "changedtick", bufnr: integer, changedtick: integer)
|
||||
--- @field on_detach? fun(_: "detach", bufnr: integer)
|
||||
--- @field on_reload? fun(_: "reload", bufnr: integer)
|
||||
--- @field utf_sizes? boolean
|
||||
--- @field preview? boolean
|
||||
|
||||
@@ -18,9 +18,9 @@ error('Cannot require a meta file')
|
||||
|
||||
--- @class vim.api.keyset.clear_autocmds
|
||||
--- @field buffer? integer
|
||||
--- @field event? any
|
||||
--- @field group? any
|
||||
--- @field pattern? any
|
||||
--- @field event? string|string[]
|
||||
--- @field group? integer|string
|
||||
--- @field pattern? string|string[]
|
||||
|
||||
--- @class vim.api.keyset.cmd
|
||||
--- @field cmd? string
|
||||
@@ -28,12 +28,12 @@ error('Cannot require a meta file')
|
||||
--- @field count? integer
|
||||
--- @field reg? string
|
||||
--- @field bang? boolean
|
||||
--- @field args? any[]
|
||||
--- @field args? string[]
|
||||
--- @field magic? table<string,any>
|
||||
--- @field mods? table<string,any>
|
||||
--- @field nargs? any
|
||||
--- @field addr? any
|
||||
--- @field nextcmd? any
|
||||
--- @field nargs? integer|string
|
||||
--- @field addr? string
|
||||
--- @field nextcmd? string
|
||||
|
||||
--- @class vim.api.keyset.cmd_magic
|
||||
--- @field file? boolean
|
||||
@@ -72,20 +72,20 @@ error('Cannot require a meta file')
|
||||
--- @field info? string
|
||||
|
||||
--- @class vim.api.keyset.context
|
||||
--- @field types? any[]
|
||||
--- @field types? string[]
|
||||
|
||||
--- @class vim.api.keyset.create_augroup
|
||||
--- @field clear? any
|
||||
--- @field clear? boolean
|
||||
|
||||
--- @class vim.api.keyset.create_autocmd
|
||||
--- @field buffer? integer
|
||||
--- @field callback? any
|
||||
--- @field callback? string|(fun(args: vim.api.keyset.create_autocmd.callback_args): boolean?)
|
||||
--- @field command? string
|
||||
--- @field desc? string
|
||||
--- @field group? any
|
||||
--- @field group? integer|string
|
||||
--- @field nested? boolean
|
||||
--- @field once? boolean
|
||||
--- @field pattern? any
|
||||
--- @field pattern? string|string[]
|
||||
|
||||
--- @class vim.api.keyset.echo_opts
|
||||
--- @field verbose? boolean
|
||||
@@ -103,19 +103,19 @@ error('Cannot require a meta file')
|
||||
|
||||
--- @class vim.api.keyset.exec_autocmds
|
||||
--- @field buffer? integer
|
||||
--- @field group? any
|
||||
--- @field group? integer|string
|
||||
--- @field modeline? boolean
|
||||
--- @field pattern? any
|
||||
--- @field pattern? string|string[]
|
||||
--- @field data? any
|
||||
|
||||
--- @class vim.api.keyset.exec_opts
|
||||
--- @field output? boolean
|
||||
|
||||
--- @class vim.api.keyset.get_autocmds
|
||||
--- @field event? any
|
||||
--- @field group? any
|
||||
--- @field pattern? any
|
||||
--- @field buffer? any
|
||||
--- @field event? string|string[]
|
||||
--- @field group? integer|string
|
||||
--- @field pattern? string|string[]
|
||||
--- @field buffer? integer|integer[]
|
||||
|
||||
--- @class vim.api.keyset.get_commands
|
||||
--- @field builtin? boolean
|
||||
@@ -154,17 +154,17 @@ error('Cannot require a meta file')
|
||||
--- @field altfont? boolean
|
||||
--- @field nocombine? boolean
|
||||
--- @field default? boolean
|
||||
--- @field cterm? any
|
||||
--- @field foreground? any
|
||||
--- @field fg? any
|
||||
--- @field background? any
|
||||
--- @field bg? any
|
||||
--- @field ctermfg? any
|
||||
--- @field ctermbg? any
|
||||
--- @field special? any
|
||||
--- @field sp? any
|
||||
--- @field link? any
|
||||
--- @field global_link? any
|
||||
--- @field cterm? integer|string
|
||||
--- @field foreground? integer|string
|
||||
--- @field fg? integer|string
|
||||
--- @field background? integer|string
|
||||
--- @field bg? integer|string
|
||||
--- @field ctermfg? integer|string
|
||||
--- @field ctermbg? integer|string
|
||||
--- @field special? integer|string
|
||||
--- @field sp? integer|string
|
||||
--- @field link? integer|string
|
||||
--- @field global_link? integer|string
|
||||
--- @field fallback? boolean
|
||||
--- @field blend? integer
|
||||
--- @field fg_indexed? boolean
|
||||
@@ -201,7 +201,7 @@ error('Cannot require a meta file')
|
||||
--- @field wins? any[]
|
||||
|
||||
--- @class vim.api.keyset.open_term
|
||||
--- @field on_input? function
|
||||
--- @field on_input? fun(_: "input", term: integer, bufnr: integer, data: any)
|
||||
--- @field force_crlf? boolean
|
||||
|
||||
--- @class vim.api.keyset.option
|
||||
@@ -227,20 +227,20 @@ error('Cannot require a meta file')
|
||||
--- @field do_source? boolean
|
||||
|
||||
--- @class vim.api.keyset.set_decoration_provider
|
||||
--- @field on_start? function
|
||||
--- @field on_buf? function
|
||||
--- @field on_win? function
|
||||
--- @field on_line? function
|
||||
--- @field on_end? function
|
||||
--- @field _on_hl_def? function
|
||||
--- @field _on_spell_nav? function
|
||||
--- @field on_start? fun(_: "start", tick: integer)
|
||||
--- @field on_buf? fun(_: "buf", bufnr: integer, tick: integer)
|
||||
--- @field on_win? fun(_: "win", winid: integer, bufnr: integer, toprow: integer, botrow: integer)
|
||||
--- @field on_line? fun(_: "line", winid: integer, bufnr: integer, row: integer)
|
||||
--- @field on_end? fun(_: "end", tick: integer)
|
||||
--- @field _on_hl_def? fun(_: "hl_def")
|
||||
--- @field _on_spell_nav? fun(_: "spell_nav")
|
||||
|
||||
--- @class vim.api.keyset.set_extmark
|
||||
--- @field id? integer
|
||||
--- @field end_line? integer
|
||||
--- @field end_row? integer
|
||||
--- @field end_col? integer
|
||||
--- @field hl_group? number|string
|
||||
--- @field hl_group? integer|string
|
||||
--- @field virt_text? any[]
|
||||
--- @field virt_text_pos? string
|
||||
--- @field virt_text_win_col? integer
|
||||
@@ -258,10 +258,10 @@ error('Cannot require a meta file')
|
||||
--- @field virt_lines_leftcol? boolean
|
||||
--- @field strict? boolean
|
||||
--- @field sign_text? string
|
||||
--- @field sign_hl_group? number|string
|
||||
--- @field number_hl_group? number|string
|
||||
--- @field line_hl_group? number|string
|
||||
--- @field cursorline_hl_group? number|string
|
||||
--- @field sign_hl_group? integer|string
|
||||
--- @field number_hl_group? integer|string
|
||||
--- @field line_hl_group? integer|string
|
||||
--- @field cursorline_hl_group? integer|string
|
||||
--- @field conceal? string
|
||||
--- @field spell? boolean
|
||||
--- @field ui_watched? boolean
|
||||
@@ -292,7 +292,7 @@ error('Cannot require a meta file')
|
||||
--- @field relative? string
|
||||
--- @field split? string
|
||||
--- @field win? integer
|
||||
--- @field bufpos? any[]
|
||||
--- @field bufpos? integer[]
|
||||
--- @field external? boolean
|
||||
--- @field focusable? boolean
|
||||
--- @field mouse? boolean
|
||||
@@ -315,12 +315,12 @@ error('Cannot require a meta file')
|
||||
--- @field end_vcol? integer
|
||||
|
||||
--- @class vim.api.keyset.xdl_diff
|
||||
--- @field on_hunk? function
|
||||
--- @field on_hunk? fun(start_a: integer, count_a: integer, start_b: integer, count_b: integer): integer?
|
||||
--- @field result_type? string
|
||||
--- @field algorithm? string
|
||||
--- @field ctxlen? integer
|
||||
--- @field interhunkctxlen? integer
|
||||
--- @field linematch? any
|
||||
--- @field linematch? boolean|integer
|
||||
--- @field ignore_whitespace? boolean
|
||||
--- @field ignore_whitespace_change? boolean
|
||||
--- @field ignore_whitespace_change_at_eol? boolean
|
||||
|
||||
@@ -73,6 +73,51 @@ error('Cannot require a meta file')
|
||||
--- @field buflocal? boolean
|
||||
--- @field buffer? integer
|
||||
|
||||
--- @class vim.api.keyset.create_autocmd.callback_args
|
||||
--- @field id integer autocommand id
|
||||
--- @field event string name of the triggered event |autocmd-events|
|
||||
--- @field group? integer autocommand group id, if any
|
||||
--- @field match string expanded value of <amatch>
|
||||
--- @field buf integer expanded value of <abuf>
|
||||
--- @field file string expanded value of <afile>
|
||||
--- @field data? any arbitrary data passed from |nvim_exec_autocmds()| *event-data*
|
||||
|
||||
--- @class vim.api.keyset.create_user_command.command_args
|
||||
--- @field name string Command name
|
||||
---
|
||||
--- The args passed to the command, if any <args>
|
||||
--- @field args string
|
||||
---
|
||||
--- The args split by unescaped whitespace
|
||||
--- (when more than one argument is allowed), if any <f-args>
|
||||
--- @field fargs string[]
|
||||
---
|
||||
--- Number of arguments |:command-nargs|
|
||||
--- @field nargs string
|
||||
---
|
||||
--- "true" if the command was executed with a ! modifier <bang>
|
||||
--- @field bang boolean
|
||||
---
|
||||
--- The starting line of the command range <line1>
|
||||
--- @field line1 integer
|
||||
---
|
||||
--- The final line of the command range <line2>
|
||||
--- @field line2 integer
|
||||
---
|
||||
--- The number of items in the command range: 0, 1, or 2 <range>
|
||||
--- @field range integer
|
||||
---
|
||||
--- Any count supplied <count>
|
||||
--- @field count integer
|
||||
--- The optional register, if specified <reg>
|
||||
--- @field reg string
|
||||
--- Command modifiers, if any <mods>
|
||||
--- @field mods string
|
||||
---
|
||||
--- Command modifiers in a structured format. Has the same structure as the
|
||||
--- "mods" key of |nvim_parse_cmd()|.
|
||||
--- @field smods table
|
||||
|
||||
--- @class vim.api.keyset.command_info
|
||||
--- @field name string
|
||||
--- @field definition string
|
||||
|
||||
Reference in New Issue
Block a user