make PutCursorOnNode open ancestors until target node is visible

This commit is contained in:
Martin Grenfell 2008-06-06 13:21:55 +12:00
parent fb3c4f9212
commit 600f2cac14

View File

@ -2072,8 +2072,14 @@ function! s:PutCursorOnNode(treenode, isJump, recurseUpward)
endif endif
call cursor(ln, col(".")) call cursor(ln, col("."))
else else
if a:recurseUpward && a:treenode.parent != {} if a:recurseUpward
call s:PutCursorOnNode(a:treenode.parent, a:isJump, 1) let node = a:treenode
while s:FindNodeLineNumber(node) == -1 && node != {}
let node = node.parent
call node.Open()
endwhile
call s:RenderView()
call s:PutCursorOnNode(a:treenode, a:isJump, 0)
endif endif
endif endif
endfunction endfunction