diff options
author | Gregory Anders <8965202+gpanders@users.noreply.github.com> | 2021-10-19 16:29:52 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-10-19 16:29:52 -0600 |
commit | 427bac687746b2bb66537b39115969c8d3a440c1 (patch) | |
tree | c52fdb54c5e5d0e47ffa9531a4ff5b33aaadf7d7 /runtime/lua/vim/diagnostic.lua | |
parent | a2994c82e355b6591299d16df1dead86e875acd1 (diff) | |
download | rneovim-427bac687746b2bb66537b39115969c8d3a440c1.tar.gz rneovim-427bac687746b2bb66537b39115969c8d3a440c1.tar.bz2 rneovim-427bac687746b2bb66537b39115969c8d3a440c1.zip |
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).
Diffstat (limited to 'runtime/lua/vim/diagnostic.lua')
-rw-r--r-- | runtime/lua/vim/diagnostic.lua | 4 |
1 files changed, 4 insertions, 0 deletions
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) |