nerdtree

A tree explorer plugin for vim.
Index Commits Files Refs
commit 4428aba2a299cbd117c80e7d18068b2cbb222fff
parent 0b73db93685f9e15d889c51eaf2a6335fa9f417b
Author: Phil Runninger <prunninger@virtualhold.com>
Date:   Fri, 26 Aug 2016 08:59:25 -0400

Replace strchars() with a backward compatible workaround.

Diffstat:
Mlib/nerdtree/ui.vim | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git 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