When I hover over a diagostic, the popup appears AND sets the focus therein. The fix is easy enough…
-- Popup when hover
autocmd("CursorHold", {
pattern = "*",
callback = function() vim.diagnostic.open_float(nil, { focusable = true }) end,
})
However, there are often times when I want to copy the message to retrieve information about it using google or the like. The ability to select and copy the message is lost when focusable = false
.
What would be best in my use case would be to have the popup occur without it taking focus. That instead, if I want focus on the popup message (dare I say :))), I would use the mouse given the popup is not a buffer (thus outside by ability to select using keybindings).
The question: In designing the float’s behavior, should the default use of open_float
become the focus, or should it maintain the focus in the parent buffer?