]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(netrw): error when trying to :bd unloaded buffer
authoryasuda <yasuda@kyoto-sr.co.jp>
Wed, 4 Oct 2023 18:50:35 +0000 (20:50 +0200)
committerChristian Brabandt <cb@256bit.org>
Wed, 4 Oct 2023 18:52:44 +0000 (20:52 +0200)
closes: #13215
closes: #13082

Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/autoload/netrw.vim

index 9548b493752b215e755fb3482dfdab8e95058b59..290a0509bddb4851c6026867e3010df2ac6d04e8 100644 (file)
@@ -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")