vim-patch:9.1.0556: :bwipe doesn't remove file from jumplist of other tabpages (#29651)

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: vim/vim#15199

2e7d89b398
This commit is contained in:
zeertzjq
2024-07-11 06:26:22 +08:00
committed by GitHub
parent 3c5abf01bf
commit 07c1996c8a
3 changed files with 86 additions and 6 deletions

View File

@@ -699,7 +699,7 @@ bool close_buffer(win_T *win, buf_T *buf, int action, bool abort_if_last, bool i
if (buf->b_nwindows > 0) {
return false;
}
FOR_ALL_WINDOWS_IN_TAB(wp, curtab) {
FOR_ALL_TAB_WINDOWS(tp, wp) {
mark_forget_file(wp, buf->b_fnum);
}
if (buf->b_sfname != buf->b_ffname) {