mirror of
https://github.com/neovim/neovim.git
synced 2025-11-10 04:25:22 +00:00
lsp: replace the event that closes the signature help preview window from InsertCharPre to CursolMovedI (#11954)
In the case of InsertCharPre, it is inconvenient because the signature help is displayed when backspaced in insert mode, so change it to CursolMovedI.
This commit is contained in:
@@ -522,8 +522,7 @@ function M.open_floating_preview(contents, filetype, opts)
|
|||||||
end
|
end
|
||||||
api.nvim_buf_set_lines(floating_bufnr, 0, -1, true, contents)
|
api.nvim_buf_set_lines(floating_bufnr, 0, -1, true, contents)
|
||||||
api.nvim_buf_set_option(floating_bufnr, 'modifiable', false)
|
api.nvim_buf_set_option(floating_bufnr, 'modifiable', false)
|
||||||
-- TODO make InsertCharPre disappearing optional?
|
M.close_preview_autocmd({"CursorMoved", "CursorMovedI", "BufHidden"}, floating_winnr)
|
||||||
api.nvim_command("autocmd CursorMoved,BufHidden,InsertCharPre <buffer> ++once lua pcall(vim.api.nvim_win_close, "..floating_winnr..", true)")
|
|
||||||
return floating_bufnr, floating_winnr
|
return floating_bufnr, floating_winnr
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user