mirror of
https://github.com/neovim/neovim.git
synced 2026-05-26 14:58:28 +00:00
fix(lsp): set 'winfixbuf' in open_floating_preview() window #39058
Problem: The window opened by `vim.lsp.util.open_floating_preview()` allows its buffer to be switched. Presumably that only happens by accident and is disorienting. Solution: Set 'winfixbuf' in the open_floating_preview() window.
This commit is contained in:
@@ -1779,6 +1779,7 @@ function M.open_floating_preview(contents, syntax, opts)
|
||||
vim.wo[floating_winnr].linebreak = true -- Break lines a bit nicer
|
||||
vim.wo[floating_winnr].breakindent = true -- Slightly better list presentation.
|
||||
vim.wo[floating_winnr].smoothscroll = true -- Scroll by screen-line instead of buffer-line.
|
||||
vim.wo[floating_winnr].winfixbuf = true -- Disable buffer switching.
|
||||
|
||||
vim.bo[floating_bufnr].modifiable = false
|
||||
vim.bo[floating_bufnr].bufhidden = 'wipe'
|
||||
|
||||
Reference in New Issue
Block a user