docs: misc, options, pos/range

This commit is contained in:
Justin M. Keyes
2026-05-20 11:47:24 +02:00
parent 88f3f0eeec
commit f5fae7aa5c
17 changed files with 120 additions and 133 deletions

View File

@@ -10,10 +10,8 @@ local api = vim.api
local validate = vim.validate
local util = require('vim.pos._util')
--- Represents a well-defined position.
---
--- A |vim.Pos| object contains the {row} and {col} coordinates of a position.
--- To create a new |vim.Pos| object, call `vim.pos()`.
--- Represents a buffer position based on [api-indexing] (0-indexed, end-exclusive ranges).
--- Call `vim.pos()` to create a new `vim.Pos` by passing the {buf}, {row}, and {col} of a position.
---
--- Example:
--- ```lua
@@ -170,7 +168,7 @@ end
--- Example:
--- ```lua
--- local cursor_pos = vim.api.nvim_win_get_cursor(0)
--- local pos = vim.pos.lsp(0, cursor_pos)
--- local pos = vim.pos.cursor(0, cursor_pos)
--- ```
---@param buf integer
---@param pos [integer, integer] (lnum, col) tuple