function getCodeEditor(editor) {
        var r = getCodeOrDiffEditor(editor);
        return r.codeEditor || (r.diffEditor && r.diffEditor.getModifiedEditor()) || null;
    }
Uses `editor.getControl()` and returns either the code editor, or the modified editor of a diff editor or nothing.