function _showEditor(document, pane, editorOptions) {
        // Ensure a main editor exists for this document to show in the UI
        var createdNewEditor = false,
            editor = document._masterEditor;

        // Check if a master editor is not set already or the current master editor doesn't belong
        // to the pane container requested - to support creation of multiple full editors
        // This check is required as _masterEditor is the active full editor for the document
        // and there can be existing full editor created for other panes
        if (editor && editor._paneId && editor._paneId !== pane.id) {
            editor = document._checkAssociatedEditorForPane(pane.id);
        }

        if (!editor) {
            // Performance (see #4757) Chrome wastes time messing with selection
            // that will just be changed at end, so clear it for now
            if (window.getSelection && window.getSelection().empty) {  // Chrome
                window.getSelection().empty();
            }

            // Editor doesn't exist: populate a new Editor with the text
            editor = _createFullEditorForDocument(document, pane, editorOptions);
            createdNewEditor = true;
        } else if (editor.$el.parent()[0] !== pane.$content[0]) {
            // editor does exist but is not a child of the pane so add it to the
            //  pane (which will switch the view's container as well)
            pane.addView(editor);
        }

        // show the view
        pane.showView(editor);

        if (MainViewManager.getActivePaneId() === pane.id) {
            // give it focus
            editor.focus();
        }

        if (createdNewEditor) {
            _restoreEditorViewState(editor);
        }
    }
Create and/or show the editor for the specified document
@param {!Document} document - document to edit
@param {!Pane} pane - pane to show it in
@param {!Object} editorOptions - If specified, contains
editor options that can be passed to CodeMirror
@private