From 07c1996c8ad69bae559406ae17c415e6cbd345e8 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Thu, 11 Jul 2024 06:26:22 +0800 Subject: 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 https://github.com/vim/vim/commit/2e7d89b39883b0cfd3e615b02bd55186e00fb7ce --- src/nvim/buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index 6878b02a6e..d894844c6d 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -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) { -- cgit