vim.pos._util
Methods6
function M.get_lines(buf: integer, rows: integer[]) -> {integer, string}
Gets the zero-indexed lines from the given buffer. Works on unloaded buffers by reading the file and bypass buf reading events. Falls back to loading the buffer and nvimbufget_lines for buffers with non-file URI.
Parameters
bufintegerbuffer handle to get the lines from
rowsinteger[]zero-indexed line numbers
Returns
- {integer, string}
a table mapping rows to lines
function M.get_line(buf: integer, row: integer) -> the string
Gets the zero-indexed line from the given buffer. Works on unloaded buffers by reading the file and bypass buf reading events. Falls back to loading the buffer and nvimbufget_lines for buffers with non-file URI.
Parameters
bufintegerbuffer handle to get the lines from
rowintegerzero-indexed line number
Returns
thestringline at row in filename
function M.to_lsp(buf: integer, row: integer, col: integer, position_encoding: lsp.PositionEncodingKind) -> table
function M.from_lsp(buf: integer, position: lsp.Position, position_encoding: lsp.PositionEncodingKind) -> ...uinteger
function M.to_mark(row: integer, col: integer) -> (lnum integer, col integer)
function M.from_mark(lnum: integer, col: integer) -> (row integer, col integer)
Fields1
M.cmp_pos : {"lt" | "le" | "gt" | "ge" | "eq" | "ne", fun(a_row: integer, a_col: integer, b_row: integer, b_col: integer) -> boolean}