mirror of
https://github.com/neovim/neovim.git
synced 2026-10-26 15:40:20 -05:00
fix(lsp): fix window to set cursor for inline completion (#36444)
This commit is contained in:
1 parent
b80d390765
commit
20a392fe38
1 file changed
+3
-1
@@ -344,7 +344,9 @@ function Completor:accept(item)
|
||||
lines
|
||||
)
|
||||
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,
|
||||
(#lines == 1 and pos[2] or 0) + #lines[#lines],
|
||||
})
|
||||
|
||||
Reference in new issue
Block a user