Explorar o código

Add secondary check for listed buffers when closing.

If BufExplorer's MRUList is empty or has no listed buffers in it, create
an array of listed buffers from vim's buffer list instead.
Phil Runninger %!s(int64=10) %!d(string=hai) anos
pai
achega
f5d6668ede
Modificáronse 1 ficheiros con 3 adicións e 0 borrados
  1. 3 0
      plugin/bufexplorer.vim

+ 3 - 0
plugin/bufexplorer.vim

@@ -914,6 +914,9 @@ endfunction
 function! s:Close()
     " Get only the listed buffers.
     let listed = filter(copy(s:MRUList), "buflisted(v:val)")
+    if len(listed) == 0
+        let listed = filter(range(1, bufnr('$')), "buflisted(v:val)")
+    endif
 
     " If we needed to split the main window, close the split one.
     if s:splitMode != "" && bufwinnr(s:originBuffer) != -1