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

patch 9.1.0556: :bwipe doesn't remove file from jumplist of other tabpages

Problem:  :bwipe doesn't remove file from jumplist and tagstack of other
          tabpages. Time complexity of mark_forget_file() is O(n^2) when
          removing all entries (after v9.1.0554)
Solution: Use FOR_ALL_TAB_WINDOWS().  Start the loops over the arrays
          from the end instead of the start (zeertzjq)

closes: #15199

Signed-off-by: zeertzjq <zeertzjq@outlook.com>
Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
zeertzjq
2024-07-10 19:36:36 +02:00
committed by Christian Brabandt
parent a3a14d5469
commit 2e7d89b398
5 changed files with 95 additions and 12 deletions

View File

@@ -750,13 +750,14 @@ aucmd_abort:
*/
if (wipe_buf)
{
win_T *wp;
tabpage_T *tp;
win_T *wp;
// Do not wipe out the buffer if it is used in a window.
if (buf->b_nwindows > 0)
return FALSE;
FOR_ALL_WINDOWS(wp)
FOR_ALL_TAB_WINDOWS(tp, wp)
mark_forget_file(wp, buf->b_fnum);
if (action == DOBUF_WIPE_REUSE)