changeset 33458:f4c83cd2132c

runtime(netrw): error when trying to :bd unloaded buffer Commit: https://github.com/vim/vim/commit/4dbb2669e9ed9ec6864705dcb569715e417e1303 Author: yasuda <yasuda@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 <cb@256bit.org>
author Christian Brabandt <cb@256bit.org>
date Wed, 04 Oct 2023 21:00:03 +0200
parents d4eb0529d7dc
children 0eda094f9b7e
files runtime/autoload/netrw.vim
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- 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")