From 01be30f638151a5654b5bc899080c49a63c2d9eb Mon Sep 17 00:00:00 2001 From: Luis Calle <53507599+TheLeoP@users.noreply.github.com> Date: Mon, 6 Apr 2026 10:51:36 -0500 Subject: 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 --- runtime/lua/vim/lsp/inline_completion.lua | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'runtime/lua/vim/lsp/inline_completion.lua') diff --git a/runtime/lua/vim/lsp/inline_completion.lua b/runtime/lua/vim/lsp/inline_completion.lua index e0513a13f0..a6d8e80957 100644 --- a/runtime/lua/vim/lsp/inline_completion.lua +++ b/runtime/lua/vim/lsp/inline_completion.lua @@ -223,7 +223,8 @@ function Completor:show(hint) if current.range then row, col = current.range:to_extmark() else - row, col = vim.pos.cursor(api.nvim_win_get_cursor(vim.fn.bufwinid(self.bufnr))):to_extmark() + row, col = + vim.pos.cursor(self.bufnr, api.nvim_win_get_cursor(vim.fn.bufwinid(self.bufnr))):to_extmark() end -- To ensure that virtual text remains visible continuously (without flickering) @@ -245,7 +246,7 @@ function Completor:show(hint) -- At least, characters before the cursor should be skipped. if api.nvim_win_get_buf(winid) == self.bufnr then local cursor_row, cursor_col = - vim.pos.cursor(api.nvim_win_get_cursor(winid), { buf = self.bufnr }):to_extmark() + vim.pos.cursor(self.bufnr, api.nvim_win_get_cursor(winid)):to_extmark() if row == cursor_row then skip = math.max(skip, cursor_col - col + 1) end -- cgit