From 427bac687746b2bb66537b39115969c8d3a440c1 Mon Sep 17 00:00:00 2001 From: Gregory Anders <8965202+gpanders@users.noreply.github.com> Date: Tue, 19 Oct 2021 16:29:52 -0600 Subject: 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). --- runtime/lua/vim/diagnostic.lua | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'runtime/lua/vim') diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua index 53a31f4d3c..4cf22282a2 100644 --- a/runtime/lua/vim/diagnostic.lua +++ b/runtime/lua/vim/diagnostic.lua @@ -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) -- cgit