code: function Cursor() {
    // If true, cursor should be rendered to the right of the char at offset p-1
    // rather than at the left edge of the char at offset p. This can happen when
    // user presses the "end" key or clicks past the end of a line.
    this.rightEnd = false;
  
    // Used for tracking previous left position in pixels, needed to implement
    // up/down arrows.
    this.prevLeft = null;
  
    // Used for rendering. Row is also needed to implement up/down arrows.
    this.row = 0;   // row (line number)
    this.left = 0;  // left position, in pixels
  
    this.blinkTimer_ = 0;
  
    this.el_ = createDiv({
      position: 'absolute',
      width: '2px',
      backgroundColor: '#000',
      zIndex: '2'
    });
  
    window.setInterval((function() {
      if (this.blinkTimer_ === -1) return;
      this.blinkTimer_ = (this.blinkTimer_ + 1) % 10;
      // Visible 60% of the time, hidden 40% of the time.
      this.el_.style.visibility = (this.blinkTimer_ < 6) ? 'visible' : 'hidden';
    }).bind(this), 100);
  }
docs: ////////////////////////////////////////////////////////////////////////////// Cursor