mirror of
https://github.com/neovim/neovim.git
synced 2025-12-09 16:12:48 +00:00
vim-patch:9.1.0147: Cannot keep a buffer focused in a window
Problem: Cannot keep a buffer focused in a window
(Amit Levy)
Solution: Add the 'winfixbuf' window-local option
(Colin Kennedy)
fixes: vim/vim#6445
closes: vim/vim#13903
2157035637
N/A patch:
vim-patch:58f1e5c0893a
This commit is contained in:
14
runtime/lua/vim/_meta/options.lua
generated
14
runtime/lua/vim/_meta/options.lua
generated
@@ -6746,6 +6746,8 @@ vim.bo.swf = vim.bo.swapfile
|
||||
--- "split" when both are present.
|
||||
--- uselast If included, jump to the previously used window when
|
||||
--- jumping to errors with `quickfix` commands.
|
||||
--- If a window has 'winfixbuf' enabled, 'switchbuf' is currently not
|
||||
--- applied to the split window.
|
||||
---
|
||||
--- @type string
|
||||
vim.o.switchbuf = "uselast"
|
||||
@@ -7874,6 +7876,18 @@ vim.o.wi = vim.o.window
|
||||
vim.go.window = vim.o.window
|
||||
vim.go.wi = vim.go.window
|
||||
|
||||
--- If enabled, the buffer and any window that displays it are paired.
|
||||
--- For example, attempting to change the buffer with `:edit` will fail.
|
||||
--- Other commands which change a window's buffer such as `:cnext` will
|
||||
--- also skip any window with 'winfixbuf' enabled. However if a command
|
||||
--- has an "!" option, a window can be forced to switch buffers.
|
||||
---
|
||||
--- @type boolean
|
||||
vim.o.winfixbuf = false
|
||||
vim.o.wfb = vim.o.winfixbuf
|
||||
vim.wo.winfixbuf = vim.o.winfixbuf
|
||||
vim.wo.wfb = vim.wo.winfixbuf
|
||||
|
||||
--- Keep the window height when windows are opened or closed and
|
||||
--- 'equalalways' is set. Also for `CTRL-W_=`. Set by default for the
|
||||
--- `preview-window` and `quickfix-window`.
|
||||
|
||||
Reference in New Issue
Block a user