From 013c607ba4bc2e459f3f5f70a69f9f13bcf77f35 Mon Sep 17 00:00:00 2001 From: Rick van Hattem Date: Fri, 22 May 2015 13:14:01 +0200 Subject: [PATCH] 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 --- lib/nerdtree/path.vim | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lib/nerdtree/path.vim b/lib/nerdtree/path.vim index c0242d0..2af07dd 100644 --- 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 "============================================================