fix flag rendering for cascading dirs

Use the innermost dirs flags only. Previously each dirs flags were
rendered inline i.e.

    [x]dir1/[y]dir2/[z]dir3/

This looked bad and broke the UI. Now we only render the flags for dir3
- and render them on the left side of the cascade.

Not sure if this is ultimately the right decision - but will do for now.
This commit is contained in:
Martin Grenfell
2015-11-25 22:12:52 +00:00
parent af39458989
commit fb15cfbf45
3 changed files with 5 additions and 5 deletions

View File

@@ -40,9 +40,7 @@ endfunction
"FUNCTION: Path.cacheDisplayString() {{{1
function! s:Path.cacheDisplayString() abort
let self.cachedDisplayString = self.flagSet.renderToString()
let self.cachedDisplayString .= self.getLastPathComponent(1)
let self.cachedDisplayString = self.getLastPathComponent(1)
if self.isExecutable
let self.cachedDisplayString = self.cachedDisplayString . '*'

View File

@@ -84,7 +84,9 @@ function! s:TreeDirNode.displayString()
let sym = cascade[-1].isOpen ? g:NERDTreeDirArrowCollapsible : g:NERDTreeDirArrowExpandable
return sym . ' ' . rv
let flags = cascade[-1].path.flagSet.renderToString()
return sym . ' ' . flags . rv
endfunction
"FUNCTION: TreeDirNode.findNode(path) {{{1

View File

@@ -83,7 +83,7 @@ endfunction
"Return:
"a string that can be used in the view to represent this node
function! s:TreeFileNode.displayString()
return self.path.displayString()
return self.path.flagSet.renderToString() . self.path.displayString()
endfunction
"FUNCTION: TreeFileNode.equals(treenode) {{{1