diff options
| author | Luis Calle <53507599+TheLeoP@users.noreply.github.com> | 2026-04-06 10:51:36 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-04-06 11:51:36 -0400 |
| commit | 01be30f638151a5654b5bc899080c49a63c2d9eb (patch) | |
| tree | bb9bb10cdac00e028f5bf94819e97dec7fca26fd /runtime/lua/vim/lsp/inline_completion.lua | |
| parent | 595e58f47ffe7598676c82dbfc84280883897d48 (diff) | |
| download | rneovim-01be30f638151a5654b5bc899080c49a63c2d9eb.tar.gz rneovim-01be30f638151a5654b5bc899080c49a63c2d9eb.tar.bz2 rneovim-01be30f638151a5654b5bc899080c49a63c2d9eb.zip | |
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
Diffstat (limited to 'runtime/lua/vim/lsp/inline_completion.lua')
| -rw-r--r-- | runtime/lua/vim/lsp/inline_completion.lua | 5 |
1 files changed, 3 insertions, 2 deletions
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 |