mirror of
https://github.com/preservim/nerdtree.git
synced 2025-11-08 11:23:48 -05:00
Catch all errors, not just NERDTree errors. (#894)
When middle-clicking, the s:TreeFileNode.GetSelected() function is called along the way. If this is done outside of the NERDTree window, there is not "b:NERDTree" variable, and the "E121: Undefined variable" exception is thrown. This function was trying to catch only the NERDTree specific errors; thus, it let the Undefined variable exception slip by. This commit causes the function to catch all errors.
This commit is contained in:
@@ -180,7 +180,7 @@ function! s:TreeFileNode.GetSelected()
|
|||||||
endif
|
endif
|
||||||
|
|
||||||
return b:NERDTree.root.findNode(l:path)
|
return b:NERDTree.root.findNode(l:path)
|
||||||
catch /^NERDTree/
|
catch
|
||||||
return {}
|
return {}
|
||||||
endtry
|
endtry
|
||||||
endfunction
|
endfunction
|
||||||
|
|||||||
Reference in New Issue
Block a user