src/view/MainViewManager.js
function _activeEditorChange(e, current) {
        if (current) {
            var $container = current.$el.parent().parent(),
                pane = _getPaneFromElement($container);

            if (pane) {
                // Editor is a full editor
                if (pane.id !== _activePaneId) {
                    // we just need to set the active pane in this case
                    //  it will dispatch the currentFileChange message as well
                    //  as dispatching other events when the active pane changes
                    setActivePaneId(pane.id);
                }
            } else {
                // Editor is an inline editor, find the parent pane
                var parents = $container.parents(".view-pane");
                if (parents.length === 1) {
                    $container = $(parents[0]);
                    pane = _getPaneFromElement($container);
                    if (pane) {
                        if (pane.id !== _activePaneId) {
                            // activate the pane which will put focus in the pane's doc
                            setActivePaneId(pane.id);
                            // reset the focus to the inline editor
                            current.focus();
                        }
                    }
                }
            }
        }
    }
function _activeEditorChange(e, current) {
        if (current) {
            var $container = current.$el.parent().parent(),
                pane = _getPaneFromElement($container);

            if (pane) {
                // Editor is a full editor
                if (pane.id !== _activePaneId) {
                    // we just need to set the active pane in this case
                    //  it will dispatch the currentFileChange message as well
                    //  as dispatching other events when the active pane changes
                    setActivePaneId(pane.id);
                }
            } else {
                // Editor is an inline editor, find the parent pane
                var parents = $container.parents(".view-pane");
                if (parents.length === 1) {
                    $container = $(parents[0]);
                    pane = _getPaneFromElement($container);
                    if (pane) {
                        if (pane.id !== _activePaneId) {
                            // activate the pane which will put focus in the pane's doc
                            setActivePaneId(pane.id);
                            // reset the focus to the inline editor
                            current.focus();
                        }
                    }
                }
            }
        }
    }
function _activeEditorChange ( e , current ) { if ( current ) { var $container = current . $el . parent ( ) . parent ( ) , pane = _getPaneFromElement ( $container ) ; if ( pane ) { // Editor is a full editor if ( pane . id !== _activePaneId ) { // we just need to set the active pane in this case //  it will dispatch the currentFileChange message as well //  as dispatching other events when the active pane changes setActivePaneId ( pane . id ) ; } } else { // Editor is an inline editor, find the parent pane var parents = $container . parents ( ".view-pane" ) ; if ( parents . length === 1 ) { $container = $ ( parents [ 0 ] ) ; pane = _getPaneFromElement ( $container ) ; if ( pane ) { if ( pane . id !== _activePaneId ) { // activate the pane which will put focus in the pane's doc setActivePaneId ( pane . id ) ; // reset the focus to the inline editor current . focus ( ) ; } } } } } }
EditorManager.activeEditorChange handler
This event is triggered when an visible editor gains focus
Therefore we need to Activate the pane that the active editor belongs to
@private
@param {!jQuery.Event} e - jQuery Event object
@param {Editor=} current - editor being made the current editor
EditorManager . activeEditorChange handler This event is triggered when an visible editor gains focus Therefore we need to Activate the pane that the active editor belongs to