mirror of
https://github.com/neovim/neovim.git
synced 2025-10-08 19:06:31 +00:00
api/window: validate cursor in nvim_win_set_buf
validate_cursor() is called regularly, but only for the current window. When changing the buffer for a non-current window, we need to invoke it in the context of that window.
This commit is contained in:
@@ -67,6 +67,10 @@ void nvim_win_set_buf(Window window, Buffer buffer, Error *err)
|
||||
buffer);
|
||||
}
|
||||
|
||||
// If window is not current, state logic will not validate its cursor.
|
||||
// So do it now.
|
||||
validate_cursor();
|
||||
|
||||
restore_win(save_curwin, save_curtab, false);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user