Просмотр исходного кода

Encapsulate the need for `:silent` within `s:GetBufferInfo()`.

This allows callers to be unaware of this implementation detail.
Michael Henry 9 месяцев назад
Родитель
Сommit
8970ac0fd2
1 измененных файлов с 4 добавлено и 3 удалено
  1. 4 3
      plugin/bufexplorer.vim

+ 4 - 3
plugin/bufexplorer.vim

@@ -607,7 +607,7 @@ function! BufExplorer()
     " Forget any cached MRU ordering from previous invocations.
     unlet! s:mruOrder
 
-    silent let s:raw_buffer_listing = s:GetBufferInfo(0)
+    let s:raw_buffer_listing = s:GetBufferInfo(0)
 
     call s:MRUGarbageCollectBufs()
     call s:MRUGarbageCollectTabs()
@@ -901,8 +901,9 @@ function! s:GetBufferInfo(bufnr)
     redir => bufoutput
 
     " Show all buffers including the unlisted ones. [!] tells Vim to show the
-    " unlisted ones.
-    buffers!
+    " unlisted ones.  `:silent` allows capturing the output via `:redir`, but
+    " prevents display to the user.
+    silent buffers!
     redir END
 
     if a:bufnr > 0