As suggested above, this should be a general function in EditorManager.