mirror of
https://github.com/preservim/nerdtree.git
synced 2024-11-22 14:10:07 +08:00
make OpenMark open the mark even if its not cached
if OpenMark is called for a mark for a file that isnt cached in the tree, just open the file anyway and dont put attempt to put the cursor on it etc
This commit is contained in:
parent
6334e99192
commit
c63e183acf
|
@ -2921,9 +2921,15 @@ endfunction
|
|||
" FUNCTION: s:OpenMark(name) {{{2
|
||||
" put the cursor on the given mark and, if its a file, open it
|
||||
function! s:OpenMark(name)
|
||||
let targetNode = s:GetNodeForMark(a:name, 0)
|
||||
call s:PutCursorOnNode(targetNode, 0, 1)
|
||||
redraw!
|
||||
try
|
||||
let targetNode = s:GetNodeForMark(a:name, 0)
|
||||
call s:PutCursorOnNode(targetNode, 0, 1)
|
||||
redraw!
|
||||
catch /NERDTree.MarkNotFound/
|
||||
call s:Echo("note - target node is not cached")
|
||||
let marks = s:GetMarks()
|
||||
let targetNode = s:oTreeFileNode.New(marks[a:name])
|
||||
endtry
|
||||
if !targetNode.path.isDirectory
|
||||
call s:OpenFileNode(targetNode)
|
||||
endif
|
||||
|
|
Loading…
Reference in New Issue
Block a user