src/extensions/default/NavigationAndHistory/NavigationProvider.js
function _navigateBack() {
        if (!jumpForwardStack.length) {
            if (activePosNotSynced) {
                currentEditPos = new NavigationFrame(EditorManager.getCurrentFullEditor(), {ranges: EditorManager.getCurrentFullEditor()._codeMirror.listSelections()});
                jumpForwardStack.push(currentEditPos);
            }
        }
        
        var navFrame = jumpBackwardStack.pop();
        
        // Check if the poped frame is the current active frame or doesn't have any valid marker information
        // if true, jump again
        if (navFrame && navFrame === currentEditPos) {
            jumpForwardStack.push(navFrame);
            _validateNavigationCmds();
            CommandManager.execute(NAVIGATION_JUMP_BACK);
            return;
        }
        
        if (navFrame) {
            // We will check for the file existence now, if it doesn't exist we will jump back again
            // but discard the popped frame as invalid.
            _validateFrame(navFrame).done(function () {
                jumpForwardStack.push(navFrame);
                navFrame.goTo();
                currentEditPos = navFrame;
            }).fail(function () {
                CommandManager.execute(NAVIGATION_JUMP_BACK);
            }).always(function () {
                _validateNavigationCmds();
            });
        }
    }
function _navigateBack() {
        if (!jumpForwardStack.length) {
            if (activePosNotSynced) {
                currentEditPos = new NavigationFrame(EditorManager.getCurrentFullEditor(), {ranges: EditorManager.getCurrentFullEditor()._codeMirror.listSelections()});
                jumpForwardStack.push(currentEditPos);
            }
        }
        
        var navFrame = jumpBackwardStack.pop();
        
        // Check if the poped frame is the current active frame or doesn't have any valid marker information
        // if true, jump again
        if (navFrame && navFrame === currentEditPos) {
            jumpForwardStack.push(navFrame);
            _validateNavigationCmds();
            CommandManager.execute(NAVIGATION_JUMP_BACK);
            return;
        }
        
        if (navFrame) {
            // We will check for the file existence now, if it doesn't exist we will jump back again
            // but discard the popped frame as invalid.
            _validateFrame(navFrame).done(function () {
                jumpForwardStack.push(navFrame);
                navFrame.goTo();
                currentEditPos = navFrame;
            }).fail(function () {
                CommandManager.execute(NAVIGATION_JUMP_BACK);
            }).always(function () {
                _validateNavigationCmds();
            });
        }
    }
function _navigateBack ( ) { if ( ! jumpForwardStack . length ) { if ( activePosNotSynced ) { currentEditPos = new NavigationFrame ( EditorManager . getCurrentFullEditor ( ) , { ranges : EditorManager . getCurrentFullEditor ( ) . _codeMirror . listSelections ( ) } ) ; jumpForwardStack . push ( currentEditPos ) ; } } var navFrame = jumpBackwardStack . pop ( ) ; // Check if the poped frame is the current active frame or doesn't have any valid marker information // if true, jump again if ( navFrame && navFrame === currentEditPos ) { jumpForwardStack . push ( navFrame ) ; _validateNavigationCmds ( ) ; CommandManager . execute ( NAVIGATION_JUMP_BACK ) ; return ; } if ( navFrame ) { // We will check for the file existence now, if it doesn't exist we will jump back again // but discard the popped frame as invalid. _validateFrame ( navFrame ) . done ( function ( ) { jumpForwardStack . push ( navFrame ) ; navFrame . goTo ( ) ; currentEditPos = navFrame ; } ) . fail ( function ( ) { CommandManager . execute ( NAVIGATION_JUMP_BACK ) ; } ) . always ( function ( ) { _validateNavigationCmds ( ) ; } ) ; } }
Command handler to navigate backward
Command handler to navigate backward