feat(vim.pos)!: require buf param on vim.pos, vim.range #38665

Problem: `buf` is optional even though its needed to perform conversions
and the ordering of `(buf, row, col)` is not consistent.

Solution: make `buf` mandatory on `vim.range` and `vim.pos` and enforce
the `buf, row, col` ordering
This commit is contained in:
Luis Calle
2026-04-06 10:51:36 -05:00
committed by GitHub
parent 595e58f47f
commit 01be30f638
8 changed files with 115 additions and 175 deletions

View File

@@ -463,7 +463,7 @@ function M.run(opts)
local winid = api.nvim_get_current_win()
local bufnr = api.nvim_win_get_buf(winid)
local pos = vim.pos.cursor(api.nvim_win_get_cursor(winid))
local pos = vim.pos.cursor(bufnr, api.nvim_win_get_cursor(winid))
local params = {
textDocument = vim.lsp.util.make_text_document_params(bufnr),
}