Use getActiveTextEditor instead of getActiveEditor