code: function () {
  			var model = this._model;
  			var selections = this._getSelections();
  			var selection = Selection.editing(selections, this._autoScrollDir === "down"); //$NON-NLS-1$
  			var pt = this.convert({x: this._autoScrollX, y: this._autoScrollY}, "page", "document"); //$NON-NLS-1$ //$NON-NLS-2$
  			var caret = selection.getCaret();
  			var lineCount = model.getLineCount();
  			var caretLine = model.getLineAtOffset(caret), lineIndex, line;
  			if (this._autoScrollDir === "up" || this._autoScrollDir === "down") { //$NON-NLS-1$ //$NON-NLS-1$
  				var _scroll = this._autoScrollY / this._getLineHeight();
  				_scroll = _scroll < 0 ? Math.floor(_scroll) : Math.ceil(_scroll);
  				lineIndex = caretLine;
  				lineIndex = Math.max(0, Math.min(lineCount - 1, lineIndex + _scroll));
  			} else if (this._autoScrollDir === "left" || this._autoScrollDir === "right") { //$NON-NLS-1$ //$NON-NLS-1$
  				lineIndex = this._getLineIndex(pt.y);
  				line = this._getLine(caretLine); 
  				pt.x += line.getBoundingClientRect(caret, false).left;
  				line.destroy();
  			}
  			if (this._blockSelection) {
  				selections = this._getBlockSelections(selections, lineIndex, pt);
  			} else if (lineIndex === 0 && (util.isMac || util.isLinux)) {
  				selection.extend(0);
  			} else if (lineIndex === lineCount - 1 && (util.isMac || util.isLinux)) {
  				selection.extend(model.getCharCount());
  			} else {
  				line = this._getLine(lineIndex);
  				selection.extend(line.getOffset(pt.x, pt.y - this._getLinePixel(lineIndex)));
  				line.destroy();
  			}
  			this._setSelection(selections, true);
  		}
docs: ********************************** Internals *****************************************