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
This commit is contained in:
Rick van Hattem 2015-05-22 13:14:01 +02:00
parent af85499eda
commit 013c607ba4

View File

@ -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
"============================================================