mirror of
https://github.com/neovim/neovim.git
synced 2025-09-06 03:18:16 +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:
@@ -888,7 +888,7 @@ void nvim_set_current_buf(Buffer buffer, Error *err)
|
||||
{
|
||||
buf_T *buf = find_buffer_by_handle(buffer, err);
|
||||
|
||||
if (!buf) {
|
||||
if (!buf || curwin->w_buffer == buf) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user