Commit: runtime(netrw): error when trying to :bd unloaded buffer

3 views
Skip to first unread message

Christian Brabandt

unread,
Oct 4, 2023, 3:00:09 PM10/4/23
to vim...@googlegroups.com
runtime(netrw): error when trying to :bd unloaded buffer

Commit: https://github.com/vim/vim/commit/4dbb2669e9ed9ec6864705dcb569715e417e1303
Author: yasuda <yas...@kyoto-sr.co.jp>
Date: Wed Oct 4 20:50:35 2023 +0200

runtime(netrw): error when trying to :bd unloaded buffer

closes: https://github.com/vim/vim/issues/13215
closes: https://github.com/vim/vim/issues/13082

Signed-off-by: Christian Brabandt <c...@256bit.org>

diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim
index 9548b4937..290a0509b 100644
--- a/runtime/autoload/netrw.vim
+++ b/runtime/autoload/netrw.vim
@@ -12044,9 +12044,9 @@ fun! s:NetrwBufRemover(bufid)
" call Decho("buf#".a:bufid." has name <".bufname(a:bufid).">","~".expand("<slnum>"))
" call Decho("buf#".a:bufid." has winid#".bufwinid(a:bufid),"~".expand("<slnum>"))

- if a:bufid > 1 && !buflisted(a:bufid) && bufname(a:bufid) == "" && bufwinid(a:bufid) == -1
+ if a:bufid > 1 && !buflisted(a:bufid) && bufloaded(a:bufid) && bufname(a:bufid) == "" && bufwinid(a:bufid) == -1
" call Decho("(s:NetrwBufRemover) removing buffer#".a:bufid,"~".expand("<slnum>"))
- exe "bd! ".a:bufid
+ exe "sil! bd! ".a:bufid
endif

" call Dret("s:NetrwBufRemover")
Reply all
Reply to author
Forward
0 new messages