feat(lsp): add 'focus' option to open_floating_preview (#16465)

When the 'focusable' and 'focus_id' parameters are set,
`open_floating_preview` assumes that it should always move focus to an
existing floating window with the same 'focus_id'. However, there are
cases where we want to make a floating window focusable, but do not want
to focus it upon calling `open_floating_preview`. To distinguish these
cases, add a boolean parameter 'focus' that, when false, prevents
moving focus.
This commit is contained in:
Gregory Anders
2021-11-29 15:37:55 -07:00
committed by GitHub
parent b16b7021ef
commit fff8827908
3 changed files with 10 additions and 2 deletions

View File

@@ -520,7 +520,7 @@ local function diagnostic_move_pos(opts, pos)
vim.api.nvim_win_get_buf(win_id),
vim.tbl_extend("keep", float_opts, {
scope = "cursor",
focusable = false,
focus = false,
})
)
end)