0
0
mirror of https://github.com/vim/vim.git synced 2025-09-23 03:43:49 -04:00

patch 9.0.0961: using deletebufline() may jump to another window

Problem:    Using deletebufline() may jump to another window.
Solution:   Do not use a window where the buffer was only in the past.
            (closes #11594)
This commit is contained in:
Bram Moolenaar
2022-11-27 19:45:49 +00:00
parent 502e91756e
commit 3da8597fc0
3 changed files with 20 additions and 1 deletions

View File

@@ -109,9 +109,12 @@ find_win_for_curbuf(void)
{
wininfo_T *wip;
// The b_wininfo list should have the windows that recently contained the
// buffer, going over this is faster than going over all the windows.
// Do check the buffer is still there.
FOR_ALL_BUF_WININFO(curbuf, wip)
{
if (wip->wi_win != NULL)
if (wip->wi_win != NULL && wip->wi_win->w_buffer == curbuf)
{
curwin = wip->wi_win;
break;