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:
parent
5381197747
commit
820955e773
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user