mirror of
https://github.com/neovim/neovim.git
synced 2025-11-14 22:39:08 +00:00
fix(lsp): fix window to set cursor for inline completion (#36444)
This commit is contained in:
@@ -344,7 +344,9 @@ function Completor:accept(item)
|
|||||||
lines
|
lines
|
||||||
)
|
)
|
||||||
local pos = item.range.start:to_cursor()
|
local pos = item.range.start:to_cursor()
|
||||||
api.nvim_win_set_cursor(vim.fn.bufwinid(self.bufnr), {
|
local win = api.nvim_get_current_win()
|
||||||
|
win = api.nvim_win_get_buf(win) == self.bufnr and win or vim.fn.bufwinid(self.bufnr)
|
||||||
|
api.nvim_win_set_cursor(win, {
|
||||||
pos[1] + #lines - 1,
|
pos[1] + #lines - 1,
|
||||||
(#lines == 1 and pos[2] or 0) + #lines[#lines],
|
(#lines == 1 and pos[2] or 0) + #lines[#lines],
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user