fix(diagnostic): allow floats to be focusable (#16093)

Setting focus_id allows the float to be focused by calling the function
a second time (a feature of open_floating_preview).
This commit is contained in:
Gregory Anders 2021-10-19 16:29:52 -06:00 committed by GitHub
parent a2994c82e3
commit 427bac6877
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1207,6 +1207,10 @@ function M.open_float(bufnr, opts)
end
end
-- Used by open_floating_preview to allow the float to be focused
if not opts.focus_id then
opts.focus_id = scope
end
local float_bufnr, winnr = require('vim.lsp.util').open_floating_preview(lines, 'plaintext', opts)
for i, hi in ipairs(highlights) do
local prefixlen, hiname = unpack(hi)