bundles/org.eclipse.orion.client.editor/web/orion/editor/editor.js
function(line, column, end, callback) {
			if (this._textView) {
				var model = this.getModel();
				line = Math.max(0, Math.min(line, model.getLineCount() - 1));
				var lineStart = model.getLineStart(line);
				var start = 0;
				if (end === undefined) {
					end = 0;
				}
				if (typeof column === "string") { //$NON-NLS-0$
					var index = model.getLine(line).indexOf(column);
					if (index !== -1) {
						start = index;
						end = start + column.length;
					}
				} else {
					start = column;
					var lineLength = model.getLineEnd(line) - lineStart;
					start = Math.min(start, lineLength);
					end = Math.min(end, lineLength);
				}
				this.moveSelection(lineStart + start, lineStart + end, callback);
			}
		}
function(line, column, end, callback) {
			if (this._textView) {
				var model = this.getModel();
				line = Math.max(0, Math.min(line, model.getLineCount() - 1));
				var lineStart = model.getLineStart(line);
				var start = 0;
				if (end === undefined) {
					end = 0;
				}
				if (typeof column === "string") { //$NON-NLS-0$
					var index = model.getLine(line).indexOf(column);
					if (index !== -1) {
						start = index;
						end = start + column.length;
					}
				} else {
					start = column;
					var lineLength = model.getLineEnd(line) - lineStart;
					start = Math.min(start, lineLength);
					end = Math.min(end, lineLength);
				}
				this.moveSelection(lineStart + start, lineStart + end, callback);
			}
		}
function ( line , column , end , callback ) { if ( this . _textView ) { var model = this . getModel ( ) ; line = Math . max ( 0 , Math . min ( line , model . getLineCount ( ) - 1 ) ) ; var lineStart = model . getLineStart ( line ) ; var start = 0 ; if ( end === undefined ) { end = 0 ; } if ( typeof column === "string" ) { //$NON-NLS-0$ var index = model . getLine ( line ) . indexOf ( column ) ; if ( index !== - 1 ) { start = index ; end = start + column . length ; } } else { start = column ; var lineLength = model . getLineEnd ( line ) - lineStart ; start = Math . min ( start , lineLength ) ; end = Math . min ( end , lineLength ) ; } this . moveSelection ( lineStart + start , lineStart + end , callback ) ; } }
Reveals a line in the editor, and optionally selects a portion of the line.
@param {Number} line - document base line index
@param {Number|String} column
@param {Number} [end]
Reveals a line in the editor and optionally selects a portion of the line .