mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 11:23:48 -05:00
Replace strchars() with a backward compatible workaround.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user