aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
diff options
context:
space:
mode:
Diffstat (limited to 'runtime/lua/vim')
-rw-r--r--runtime/lua/vim/_meta/api.lua20
-rw-r--r--runtime/lua/vim/_meta/api_keysets.lua22
-rw-r--r--runtime/lua/vim/filetype.lua1
-rw-r--r--runtime/lua/vim/treesitter.lua3
4 files changed, 35 insertions, 11 deletions
diff --git a/runtime/lua/vim/_meta/api.lua b/runtime/lua/vim/_meta/api.lua
index 49269ba631..4ad0a2e791 100644
--- a/runtime/lua/vim/_meta/api.lua
+++ b/runtime/lua/vim/_meta/api.lua
@@ -151,7 +151,7 @@ function vim.api.nvim_buf_add_highlight(buffer, ns_id, hl_group, line, col_start
--- `nvim_buf_lines_event`. Else the first notification
--- will be `nvim_buf_changedtick_event`. Not for Lua
--- callbacks.
---- @param opts table<string,function> Optional parameters.
+--- @param opts vim.api.keyset.buf_attach Optional parameters.
--- • on_lines: Lua callback invoked on change. Return `true` to detach. Args:
--- • the string "lines"
--- • buffer handle
@@ -284,7 +284,7 @@ function vim.api.nvim_buf_del_var(buffer, name) end
--- Deletes the buffer. See `:bwipeout`
---
--- @param buffer integer Buffer handle, or 0 for current buffer
---- @param opts table<string,any> Optional parameters. Keys:
+--- @param opts vim.api.keyset.buf_delete Optional parameters. Keys:
--- • force: Force deletion and ignore unsaved changes.
--- • unload: Unloaded only, do not delete. See `:bunload`
function vim.api.nvim_buf_delete(buffer, opts) end
@@ -307,7 +307,7 @@ function vim.api.nvim_buf_get_commands(buffer, opts) end
--- @param buffer integer Buffer handle, or 0 for current buffer
--- @param ns_id integer Namespace id from `nvim_create_namespace()`
--- @param id integer Extmark id
---- @param opts table<string,any> Optional parameters. Keys:
+--- @param opts vim.api.keyset.get_extmark Optional parameters. Keys:
--- • details: Whether to include the details dict
--- • hl_name: Whether to include highlight group name instead
--- of id, true if omitted
@@ -440,7 +440,7 @@ function vim.api.nvim_buf_get_option(buffer, name) end
--- @param start_col integer Starting column (byte offset) on first line
--- @param end_row integer Last line index, inclusive
--- @param end_col integer Ending column (byte offset) on last line, exclusive
---- @param opts table<string,any> Optional parameters. Currently unused.
+--- @param opts vim.api.keyset.empty Optional parameters. Currently unused.
--- @return string[]
function vim.api.nvim_buf_get_text(buffer, start_row, start_col, end_row, end_col, opts) end
@@ -626,7 +626,7 @@ function vim.api.nvim_buf_set_lines(buffer, start, end_, strict_indexing, replac
--- @param name string Mark name
--- @param line integer Line number
--- @param col integer Column/row number
---- @param opts table<string,any> Optional parameters. Reserved for future use.
+--- @param opts vim.api.keyset.empty Optional parameters. Reserved for future use.
--- @return boolean
function vim.api.nvim_buf_set_mark(buffer, name, line, col, opts) end
@@ -675,7 +675,7 @@ function vim.api.nvim_buf_set_var(buffer, name, value) end
--- @param src_id integer
--- @param line integer
--- @param chunks any[]
---- @param opts table<string,any>
+--- @param opts vim.api.keyset.empty
--- @return integer
function vim.api.nvim_buf_set_virtual_text(buffer, src_id, line, chunks, opts) end
@@ -1241,7 +1241,7 @@ function vim.api.nvim_get_keymap(mode) end
--- Marks are (1,0)-indexed. `api-indexing`
---
--- @param name string Mark name
---- @param opts table<string,any> Optional parameters. Reserved for future use.
+--- @param opts vim.api.keyset.empty Optional parameters. Reserved for future use.
--- @return any[]
function vim.api.nvim_get_mark(name, opts) end
@@ -1439,7 +1439,7 @@ function vim.api.nvim_notify(msg, log_level, opts) end
--- virtual terminal having the intended size.
---
--- @param buffer integer the buffer to use (expected to be empty)
---- @param opts table<string,function> Optional parameters.
+--- @param opts vim.api.keyset.open_term Optional parameters.
--- • on_input: Lua callback for input sent, i e keypresses in
--- terminal mode. Note: keypresses are sent raw as they would
--- be to the pty master end. For instance, a carriage return
@@ -1602,7 +1602,7 @@ function vim.api.nvim_out_write(str) end
--- Doesn't check the validity of command arguments.
---
--- @param str string Command line string to parse. Cannot contain "\n".
---- @param opts table<string,any> Optional parameters. Reserved for future use.
+--- @param opts vim.api.keyset.empty Optional parameters. Reserved for future use.
--- @return table<string,any>
function vim.api.nvim_parse_cmd(str, opts) end
@@ -1685,7 +1685,7 @@ function vim.api.nvim_replace_termcodes(str, from_part, do_lt, special) end
--- inserted in the buffer. Ignored for `cmdline-completion`.
--- @param finish boolean Finish the completion and dismiss the popup menu. Implies
--- {insert}.
---- @param opts table<string,any> Optional parameters. Reserved for future use.
+--- @param opts vim.api.keyset.empty Optional parameters. Reserved for future use.
function vim.api.nvim_select_popupmenu_item(item, insert, finish, opts) end
--- Sets the current buffer.
diff --git a/runtime/lua/vim/_meta/api_keysets.lua b/runtime/lua/vim/_meta/api_keysets.lua
index f69e5a92c7..6a3e574455 100644
--- a/runtime/lua/vim/_meta/api_keysets.lua
+++ b/runtime/lua/vim/_meta/api_keysets.lua
@@ -3,6 +3,19 @@
-- DO NOT EDIT
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 utf_sizes? boolean
+--- @field preview? boolean
+
+--- @class vim.api.keyset.buf_delete
+--- @field force? boolean
+--- @field unload? boolean
+
--- @class vim.api.keyset.clear_autocmds
--- @field buffer? integer
--- @field event? any
@@ -74,6 +87,8 @@ error('Cannot require a meta file')
--- @class vim.api.keyset.echo_opts
--- @field verbose? boolean
+--- @class vim.api.keyset.empty
+
--- @class vim.api.keyset.eval_statusline
--- @field winid? integer
--- @field maxwidth? integer
@@ -124,6 +139,10 @@ error('Cannot require a meta file')
--- @class vim.api.keyset.get_commands
--- @field builtin? boolean
+--- @class vim.api.keyset.get_extmark
+--- @field details? boolean
+--- @field hl_name? boolean
+
--- @class vim.api.keyset.get_extmarks
--- @field limit? integer
--- @field details? boolean
@@ -196,6 +215,9 @@ error('Cannot require a meta file')
--- @field desc? string
--- @field replace_keycodes? boolean
+--- @class vim.api.keyset.open_term
+--- @field on_input? function
+
--- @class vim.api.keyset.option
--- @field scope? string
--- @field win? integer
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua
index 60882d4432..e64923ab54 100644
--- a/runtime/lua/vim/filetype.lua
+++ b/runtime/lua/vim/filetype.lua
@@ -1394,6 +1394,7 @@ local filename = {
octaverc = 'octave',
['octave.conf'] = 'octave',
opam = 'opam',
+ ['pacman.log'] = 'pacmanlog',
['/etc/pam.conf'] = 'pamconf',
['pam_env.conf'] = 'pamenv',
['.pam_environment'] = 'pamenv',
diff --git a/runtime/lua/vim/treesitter.lua b/runtime/lua/vim/treesitter.lua
index e7a66c00b2..7b795380fe 100644
--- a/runtime/lua/vim/treesitter.lua
+++ b/runtime/lua/vim/treesitter.lua
@@ -362,6 +362,7 @@ end
--- - bufnr integer|nil Buffer number (nil or 0 for current buffer)
--- - pos table|nil 0-indexed (row, col) tuple. Defaults to cursor position in the
--- current window. Required if {bufnr} is not the current buffer
+--- - lang string|nil Parser language. (default: from buffer filetype)
--- - ignore_injections boolean Ignore injected languages (default true)
---
---@return TSNode | nil Node at the given position
@@ -392,7 +393,7 @@ function M.get_node(opts)
local ts_range = { row, col, row, col }
- local root_lang_tree = M.get_parser(bufnr)
+ local root_lang_tree = M.get_parser(bufnr, opts.lang)
if not root_lang_tree then
return
end