mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-09 03:43:50 -05:00
If arrows are empty strings, don't print their trailing spaces.
This commit is contained in:
@@ -104,16 +104,11 @@ function! s:TreeDirNode.displayString()
|
|||||||
endfor
|
endfor
|
||||||
|
|
||||||
" Select the appropriate open/closed status indicator symbol.
|
" Select the appropriate open/closed status indicator symbol.
|
||||||
if l:cascade[-1].isOpen
|
let l:padding = g:NERDTreeDirArrowExpandable == '' ? '' : ' '
|
||||||
let l:symbol = g:NERDTreeDirArrowCollapsible
|
let l:symbol = (l:cascade[-1].isOpen ? g:NERDTreeDirArrowCollapsible : g:NERDTreeDirArrowExpandable ) . l:padding
|
||||||
else
|
|
||||||
let l:symbol = g:NERDTreeDirArrowExpandable
|
|
||||||
endif
|
|
||||||
|
|
||||||
let l:flags = l:cascade[-1].path.flagSet.renderToString()
|
let l:flags = l:cascade[-1].path.flagSet.renderToString()
|
||||||
|
|
||||||
let l:result = l:symbol . ' ' . l:flags . l:label
|
return l:symbol . l:flags . l:label
|
||||||
return l:result
|
|
||||||
endfunction
|
endfunction
|
||||||
|
|
||||||
" FUNCTION: TreeDirNode.findNode(path) {{{1
|
" FUNCTION: TreeDirNode.findNode(path) {{{1
|
||||||
|
|||||||
@@ -321,13 +321,11 @@ function! s:TreeFileNode._renderToString(depth, drawText)
|
|||||||
if a:drawText ==# 1
|
if a:drawText ==# 1
|
||||||
|
|
||||||
let treeParts = repeat(' ', a:depth - 1)
|
let treeParts = repeat(' ', a:depth - 1)
|
||||||
|
if !self.path.isDirectory && g:NERDTreeDirArrowExpandable != ''
|
||||||
if !self.path.isDirectory
|
let treeParts .= ' '
|
||||||
let treeParts = treeParts . ' '
|
|
||||||
endif
|
endif
|
||||||
|
|
||||||
let line = treeParts . self.displayString()
|
let line = treeParts . self.displayString()
|
||||||
|
|
||||||
let output = output . line . "\n"
|
let output = output . line . "\n"
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user