Pārlūkot izejas kodu

Merge pull request #40 from PhilRunninger/prevent-extra-no-name-buffers

Add secondary check for listed buffers when closing.
jlanzarotta 9 gadi atpakaļ
vecāks
revīzija
2a1005fb68
1 mainītis faili ar 3 papildinājumiem un 0 dzēšanām
  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