public/javascripts/codemirror/js/undo.js
function(chain) {
    var shadows = [], next = this.after(chain[0].from), end = chain[chain.length - 1].to;
    while (true) {
      shadows.push(next);
      var nextNode = next.to;
      if (!nextNode || nextNode == end)
        break;
      else
        next = nextNode.historyAfter || this.before(end);
      // (The this.before(end) is a hack -- FF sometimes removes
      // properties from BR nodes, in which case the best we can hope
      // for is to not break.)
    }
    return shadows;
  }
function(chain) {
    var shadows = [], next = this.after(chain[0].from), end = chain[chain.length - 1].to;
    while (true) {
      shadows.push(next);
      var nextNode = next.to;
      if (!nextNode || nextNode == end)
        break;
      else
        next = nextNode.historyAfter || this.before(end);
      // (The this.before(end) is a hack -- FF sometimes removes
      // properties from BR nodes, in which case the best we can hope
      // for is to not break.)
    }
    return shadows;
  }
function ( chain ) { var shadows = [ ] , next = this . after ( chain [ 0 ] . from ) , end = chain [ chain . length - 1 ] . to ; while ( true ) { shadows . push ( next ) ; var nextNode = next . to ; if ( ! nextNode || nextNode == end ) break ; else next = nextNode . historyAfter || this . before ( end ) ; // (The this.before(end) is a hack -- FF sometimes removes // properties from BR nodes, in which case the best we can hope // for is to not break.) } return shadows ; }
Find the 'shadow' of a given chain by following the links in the DOM nodes at its start and end.
Find the shadow of a given chain by following the links in the DOM nodes at its start and end .