ソースを参照

Add `buf.isdir` to efficiently track whether buffer is a directory.

Michael Henry 11 ヶ月 前
コミット
dce64d5e32
1 ファイル変更2 行追加1 行削除
  1. 2 1
      plugin/bufexplorer.vim

+ 2 - 1
plugin/bufexplorer.vim

@@ -718,7 +718,8 @@ function! s:GetBufferInfo(bufnr)
             let b[key] = fnamemodify(name, val)
         endfor
 
-        if getftype(b.fullname) == "dir" && g:bufExplorerShowDirectories == 1
+        let b.isdir = getftype(b.fullname) == "dir"
+        if b.isdir && g:bufExplorerShowDirectories == 1
             let b.shortname = "<DIRECTORY>"
         endif