mirror of
https://github.com/neovim/neovim.git
synced 2025-09-18 09:18:19 +00:00
fix(api): nvim_win_set_buf(0, 0) fails if 'winfixbuf' is set #31576
## Problem With 'winfixbuf' enabled, `nvim_win_set_buf` and `nvim_set_current_buf` fail even if targeting the already-current buffer. vim.wo.winfixbuf = true vim.api.nvim_win_set_buf(0, 0) vim.api.nvim_set_current_buf(0) Solution: Check for this condition.
This commit is contained in:
@@ -59,7 +59,7 @@ void nvim_win_set_buf(Window window, Buffer buffer, Error *err)
|
||||
{
|
||||
win_T *win = find_window_by_handle(window, err);
|
||||
buf_T *buf = find_buffer_by_handle(buffer, err);
|
||||
if (!win || !buf) {
|
||||
if (!win || !buf || win->w_buffer == buf) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user