Co-authored-by: darkdi <rantovov5@gmail.com>
Co-authored-by: Qiaoxi Guo <28090444+breadtitor@users.noreply.github.com>
Co-authored-by: zaveshaa <zaveshaa@gmail.com>
This commit is contained in:
Justin M. Keyes
2026-08-23 12:38:07 -04:00
committed by GitHub
parent 211bef2315
commit 354ea3bf2a
18 changed files with 97 additions and 86 deletions

View File

@@ -10,7 +10,7 @@
--- msg = { -- Options related to the message module.
--- ---@type string|table<string, 'cmd'|'msg'|'pager'> Default message target
--- ---or table mapping |ui-messages| kinds, triggers and IDs to a target.
--- ---Table keys are are matched as a Lua pattern to the message ID. 'default'
--- ---Table keys are matched as a Lua pattern to the message ID. 'default'
--- ---mapping applies to any omitted kind: { default = 'cmd', progress = 'msg' }.
--- targets = 'cmd',
--- cmd = { -- Options related to messages in the cmdline window.

View File

@@ -226,8 +226,8 @@ function vim.api.nvim_buf_add_highlight(buffer, ns_id, hl_group, line, col_start
--- Not for Lua callbacks.
--- @param opts vim.api.keyset.buf_attach? Optional parameters.
--- - on_bytes: Called on granular changes (compared to on_lines). Not called on buffer
--- reload (`:checktime`, `:edit`, …), see `on_reload:`. Return a [lua-truthy] value
--- to detach. Args:
--- reload (`:checktime`, `:edit`, …), see `on_reload`. Returning [lua-truthy] deletes
--- the callback. Args:
--- - the string "bytes"
--- - buffer id
--- - b:changedtick
@@ -247,11 +247,12 @@ function vim.api.nvim_buf_add_highlight(buffer, ns_id, hl_group, line, col_start
--- - the string "changedtick"
--- - buffer id
--- - b:changedtick
--- - on_detach: Called on detach. Args:
--- - on_detach: Called on detach, or when the buffer is unloaded or deleted. Not called
--- when a callback returns [lua-truthy] to delete itself. Args:
--- - the string "detach"
--- - buffer id
--- - on_lines: Called on linewise changes. Not called on buffer reload (`:checktime`,
--- `:edit`, …), see `on_reload:`. Return a [lua-truthy] value to detach. Args:
--- `:edit`, …), see `on_reload`. Returning [lua-truthy] deletes the callback. Args:
--- - the string "lines"
--- - buffer id
--- - b:changedtick
@@ -954,7 +955,8 @@ function vim.api.nvim_create_augroup(name, opts) end
---
--- @see `:help autocommand`
--- @see vim.api.nvim_del_autocmd
--- @param event vim.api.keyset.events|vim.api.keyset.events[] 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`): one handler is
--- created for each event name.
--- @param opts vim.api.keyset.create_autocmd? Options dict:
--- - buf (`integer?`) Buffer id for buffer-local autocommands `autocmd-buflocal`.
--- Not allowed with {pattern}.
@@ -972,7 +974,8 @@ function vim.api.nvim_create_augroup(name, opts) end
--- - desc (`string?`) Description (for documentation and troubleshooting).
--- - group (`string|integer?`) Group name or id to match against.
--- - nested (`boolean?`, default: false) Run nested autocommands `autocmd-nested`.
--- - once (`boolean?`, default: false) Handle the event only once `autocmd-once`.
--- - once (`boolean?`, default: false) Handle the event only once `autocmd-once`. If {event}
--- is a list, each handler will fire once.
--- - pattern (`string|array?`) Pattern(s) to match literally `autocmd-pattern`.
--- @return integer # Autocommand id (number)
function vim.api.nvim_create_autocmd(event, opts) end

View File

@@ -401,7 +401,7 @@ function M.compute_diff(
position_encoding
)
-- Find the last position changed in the previous and current buffer.
-- prev_end_range is sent to the server as as the end of the changed range.
-- prev_end_range is sent to the server as the end of the changed range.
-- curr_end_range is used to grab the changed text from the latest buffer.
local prev_end_range, curr_end_range = compute_end_range(
prev_lines,