From 6a9555c0faf3fbfc8001244ae2a19da4e92babd7 Mon Sep 17 00:00:00 2001 From: David Briscoe <43559+idbrii@users.noreply.github.com> Date: Thu, 27 Feb 2025 02:05:00 -0800 Subject: doc: clarify window-id, tab-id, nvim_set_current_x #32528 Problem: Descriptions are somewhat vague. nvim_set_current_line modifies contents but nvim_set_current_buf does not, etc. Solution: - Make it clear that these functions accept or return a winid/tabid by linking to that concept in help. - Only these few files use the term "handles", so replace them with the more conventional terminology. - Add a new help section for tab-ID. This concept is unique to neovim because vim exposes tabnr, but not tab handles. This section is modelled after `:h winid`. --- runtime/lua/vim/lsp/util.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'runtime/lua/vim/lsp') diff --git a/runtime/lua/vim/lsp/util.lua b/runtime/lua/vim/lsp/util.lua index cacf7824c4..b0567e3b59 100644 --- a/runtime/lua/vim/lsp/util.lua +++ b/runtime/lua/vim/lsp/util.lua @@ -1896,7 +1896,7 @@ function M.try_trim_markdown_code_blocks(lines) return 'markdown' end ----@param window integer?: window handle or 0 for current, defaults to current +---@param window integer?: |window-ID| or 0 for current, defaults to current ---@param position_encoding 'utf-8'|'utf-16'|'utf-32' local function make_position_param(window, position_encoding) window = window or 0 @@ -1915,7 +1915,7 @@ end --- Creates a `TextDocumentPositionParams` object for the current buffer and cursor position. --- ----@param window integer?: window handle or 0 for current, defaults to current +---@param window integer?: |window-ID| or 0 for current, defaults to current ---@param position_encoding 'utf-8'|'utf-16'|'utf-32' ---@return lsp.TextDocumentPositionParams ---@see https://microsoft.github.io/language-server-protocol/specifications/specification-current/#textDocumentPositionParams @@ -1974,7 +1974,7 @@ end --- `textDocument/codeAction`, `textDocument/colorPresentation`, --- `textDocument/rangeFormatting`. --- ----@param window integer? window handle or 0 for current, defaults to current +---@param window integer?: |window-ID| or 0 for current, defaults to current ---@param position_encoding "utf-8"|"utf-16"|"utf-32" ---@return { textDocument: { uri: lsp.DocumentUri }, range: lsp.Range } function M.make_range_params(window, position_encoding) -- cgit