Register for MainViewManager.currentFileChange-event instead of the deprecated DocumentManager.currentDocumentChange