commit 450abd1820402e82f5477764a473e3ac36965c01
parent 6d3743549c822533929b3cec5cee392b17552e03
Author: Phil Runninger <prunninger@vhtcx.com>
Date: Mon, 3 Feb 2020 08:00:06 -0500
Fix indentLevelFor(), which was getting the right answer the wrong way.
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/lib/nerdtree/ui.vim b/lib/nerdtree/ui.vim
@@ -284,7 +284,11 @@ endfunction
function! s:UI._indentLevelFor(line)
" Replace multi-character DirArrows with a single space so the
" indentation calculation doesn't get messed up.
- let l:line = substitute(substitute(a:line, '\V'.g:NERDTreeDirArrowExpandable, ' ', ''), '\V'.g:NERDTreeDirArrowCollapsible, ' ', '')
+ if g:NERDTreeDirArrowExpandable ==# ''
+ let l:line = ' '.a:line
+ else
+ let l:line = substitute(substitute(a:line, '\V'.g:NERDTreeDirArrowExpandable, ' ', ''), '\V'.g:NERDTreeDirArrowCollapsible, ' ', '')
+ endif
let leadChars = match(l:line, '\M\[^ ]')
return leadChars / s:UI.IndentWid()
endfunction