Cursor switching floating window/diagnostic on movement

Hey all,

I’m experiencing some behavior that I wasn’t expecting. This happens on both nvim 0.5.x and 0.6.

When I reach a border with my cursor (direction doesn’t matter) it seems like the cursor jumps into a floating window if one exists (such as diagnostics window), is there any way to prevent this? Is this intended or a bug? (normally I’d switch to window with ww)

For a better visual/gif/example configs see:

After some help, I figured that show_line_diagnostics is probably getting called twice in a row with CursorHold when hitting an edge and switching the cursor into the window.

Setting focusable to false prevents this from happening:
vim.lsp.diagnostic.show_line_diagnostics({focusable = false})

1 Like