nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit 013c607ba4bc2e459f3f5f70a69f9f13bcf77f35
parent af85499edace2acca27ce41790ac333f62b689bb
Author: Rick van Hattem <wolph@wol.ph>
Date:   Fri, 22 May 2015 13:14:01 +0200

Fixed incompatibility with older Vim versions

Fixed incompatibility with older Vim versions that are compiled without float function support such as `log10` and `ceil`

This fixes #452
Diffstat:
Mlib/nerdtree/path.vim | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/lib/nerdtree/path.vim b/lib/nerdtree/path.vim
@@ -2,8 +2,11 @@
 "once here
 let s:NERDTreeSortStarIndex = index(g:NERDTreeSortOrder, '*')
 " used in formating sortKey, e.g. '%04d'
-let s:sortKeyFormat = "%0" . float2nr(ceil(log10(len(g:NERDTreeSortOrder)))) . "d"
-
+if exists("log10")
+    let s:sortKeyFormat = "%0" . float2nr(ceil(log10(len(g:NERDTreeSortOrder)))) . "d"
+else
+    let s:sortKeyFormat = "%04d"
+endif
 
 "CLASS: Path
 "============================================================