Parcourir la source

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

Michael Henry il y a 11 mois
Parent
commit
dce64d5e32
1 fichiers modifiés avec 2 ajouts et 1 suppressions
  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