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