From 4428aba2a299cbd117c80e7d18068b2cbb222fff Mon Sep 17 00:00:00 2001 From: Phil Runninger Date: Fri, 26 Aug 2016 08:59:25 -0400 Subject: [PATCH] Replace strchars() with a backward compatible workaround. --- lib/nerdtree/ui.vim | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/nerdtree/ui.vim b/lib/nerdtree/ui.vim index 094fa0f..d107814 100644 --- a/lib/nerdtree/ui.vim +++ b/lib/nerdtree/ui.vim @@ -282,7 +282,8 @@ endfunction function! s:UI._indentLevelFor(line) "have to do this work around because match() returns bytes, not chars let numLeadBytes = match(a:line, '\M\[^ '.g:NERDTreeDirArrowExpandable.g:NERDTreeDirArrowCollapsible.']') - let leadChars = strchars(a:line[0:numLeadBytes-1]) + " The next line is a backward-compatible workaround for strchars(a:line(0:numLeadBytes-1]). strchars() is in 7.3+ + let leadChars = len(split(a:line[0:numLeadBytes-1], '\zs')) return leadChars / s:UI.IndentWid() endfunction