From b5b025f6a3ad406929c096f63b5f1e7649d3c818 Mon Sep 17 00:00:00 2001 From: Gregory Anders <8965202+gpanders@users.noreply.github.com> Date: Wed, 24 Nov 2021 21:45:42 -0700 Subject: [PATCH] fix(diagnostic): do not focus floats in goto functions (#16433) Floating windows opened by `goto_next` and `goto_prev` should not be focused when repeating the `goto_` function. The float can still be focused by calling `open_float` with `scope = "cursor"`. --- runtime/lua/vim/diagnostic.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/runtime/lua/vim/diagnostic.lua b/runtime/lua/vim/diagnostic.lua index 74996faf3c..226c440fe7 100644 --- a/runtime/lua/vim/diagnostic.lua +++ b/runtime/lua/vim/diagnostic.lua @@ -506,7 +506,10 @@ local function diagnostic_move_pos(opts, pos) vim.schedule(function() M.open_float( vim.api.nvim_win_get_buf(win_id), - vim.tbl_extend("keep", float_opts, {scope="cursor"}) + vim.tbl_extend("keep", float_opts, { + scope = "cursor", + focusable = false, + }) ) end) end