mirror of
https://github.com/preservim/nerdtree.git
synced 2024-11-25 17:57:24 +08:00
improve the error handling of RecallMark()
This commit is contained in:
parent
c63e183acf
commit
1d9564db54
|
@ -2989,8 +2989,12 @@ endfunction
|
||||||
" FUNCTION: s:RecallMark(name) {{{2
|
" FUNCTION: s:RecallMark(name) {{{2
|
||||||
" put the cursor on the node associate with the given name
|
" put the cursor on the node associate with the given name
|
||||||
function! s:RecallMark(name)
|
function! s:RecallMark(name)
|
||||||
|
try
|
||||||
let targetNode = s:GetNodeForMark(a:name, 0)
|
let targetNode = s:GetNodeForMark(a:name, 0)
|
||||||
call s:PutCursorOnNode(targetNode, 0, 1)
|
call s:PutCursorOnNode(targetNode, 0, 1)
|
||||||
|
catch /NERDTree.MarkDoesntExist/
|
||||||
|
call s:Echo("Mark isnt cached under the current root")
|
||||||
|
endtry
|
||||||
endfunction
|
endfunction
|
||||||
" FUNCTION: s:RefreshRoot() {{{2
|
" FUNCTION: s:RefreshRoot() {{{2
|
||||||
" Reloads the current root. All nodes below this will be lost and the root dir
|
" Reloads the current root. All nodes below this will be lost and the root dir
|
||||||
|
|
Loading…
Reference in New Issue
Block a user