From 4dbb2669e9ed9ec6864705dcb569715e417e1303 Mon Sep 17 00:00:00 2001 From: yasuda Date: Wed, 4 Oct 2023 20:50:35 +0200 Subject: [PATCH] runtime(netrw): error when trying to :bd unloaded buffer closes: #13215 closes: #13082 Signed-off-by: Christian Brabandt --- runtime/autoload/netrw.vim | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runtime/autoload/netrw.vim b/runtime/autoload/netrw.vim index 9548b49375..290a0509bd 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("")) " call Decho("buf#".a:bufid." has winid#".bufwinid(a:bufid),"~".expand("")) - 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("")) - exe "bd! ".a:bufid + exe "sil! bd! ".a:bufid endif " call Dret("s:NetrwBufRemover")