code: function(offset) {
  			var charCount = this.getCharCount();
  			if (!(0 <= offset && offset <= charCount)) {
  				return -1;
  			}
  			var lineCount = this.getLineCount();
  			if (offset === charCount) {
  				return lineCount - 1; 
  			}
  			var lineStart, lineEnd;
  			var index = this._lastLineIndex;
  			if (0 <= index && index < lineCount) {
  				lineStart = this._lineOffsets[index];
  				lineEnd = index + 1 < lineCount ? this._lineOffsets[index + 1] : charCount;
  				if (lineStart <= offset && offset < lineEnd) {
  					return index;
  				}
  			}
  			var high = lineCount;
  			var low = -1;
  			while (high - low > 1) {
  				index = Math.floor((high + low) / 2);
  				lineStart = this._lineOffsets[index];
  				lineEnd = index + 1 < lineCount ? this._lineOffsets[index + 1] : charCount;
  				if (offset <= lineStart) {
  					high = index;
  				} else if (offset < lineEnd) {
  					high = index;
  					break;
  				} else {
  					low = index;
  				}
  			}
  			this._lastLineIndex = high;
  			return high;
  		}
docs: Returns the line index at the given character offset.
  <p>
  The valid offsets are 0 to char count inclusive. The line index for
  char count is <code>line count - 1</code>. Returns <code>-1</code> if
  the offset is out of range.
  </p>
  
  @param {Number} offset a character offset.
  @returns {Number} the zero based line index or <code>-1</code> if out of range.