Skip to content

Commit

Permalink
fix(diagnostic): allow floats to be focusable (neovim#16093)
Browse files Browse the repository at this point in the history
Setting focus_id allows the float to be focused by calling the function
a second time (a feature of open_floating_preview).
  • Loading branch information
gpanders committed Oct 19, 2021
1 parent a2994c8 commit 427bac6
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions runtime/lua/vim/diagnostic.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 427bac6

Please sign in to comment.
-