mirror of
https://github.com/preservim/nerdtree.git
synced 2024-11-22 11:32:25 +08:00
Fix indentLevelFor(), which was getting the right answer the wrong way.
This commit is contained in:
parent
6d3743549c
commit
450abd1820
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue
Block a user