in packages/osd-ace/src/ace/modes/x_json/worker/x_json.ace.worker.js [229:312]
this.isEqual = function(range) {
return this.start.row === range.start.row && this.end.row === range.end.row && this.start.column === range.start.column && this.end.column === range.end.column
}, this.toString = function() {
return "Range: [" + this.start.row + "/" + this.start.column + "] -> [" + this.end.row + "/" + this.end.column + "]"
}, this.contains = function(row, column) {
return 0 == this.compare(row, column)
}, this.compareRange = function(range) {
var cmp, end = range.end,
start = range.start;
return cmp = this.compare(end.row, end.column), 1 == cmp ? (cmp = this.compare(start.row, start.column), 1 == cmp ? 2 : 0 == cmp ? 1 : 0) : -1 == cmp ? -2 : (cmp = this.compare(start.row, start.column), -1 == cmp ? -1 : 1 == cmp ? 42 : 0)
}, this.comparePoint = function(p) {
return this.compare(p.row, p.column)
}, this.containsRange = function(range) {
return 0 == this.comparePoint(range.start) && 0 == this.comparePoint(range.end)
}, this.intersects = function(range) {
var cmp = this.compareRange(range);
return -1 == cmp || 0 == cmp || 1 == cmp
}, this.isEnd = function(row, column) {
return this.end.row == row && this.end.column == column
}, this.isStart = function(row, column) {
return this.start.row == row && this.start.column == column
}, this.setStart = function(row, column) {
"object" == typeof row ? (this.start.column = row.column, this.start.row = row.row) : (this.start.row = row, this.start.column = column)
}, this.setEnd = function(row, column) {
"object" == typeof row ? (this.end.column = row.column, this.end.row = row.row) : (this.end.row = row, this.end.column = column)
}, this.inside = function(row, column) {
return 0 == this.compare(row, column) ? this.isEnd(row, column) || this.isStart(row, column) ? !1 : !0 : !1
}, this.insideStart = function(row, column) {
return 0 == this.compare(row, column) ? this.isEnd(row, column) ? !1 : !0 : !1
}, this.insideEnd = function(row, column) {
return 0 == this.compare(row, column) ? this.isStart(row, column) ? !1 : !0 : !1
}, this.compare = function(row, column) {
return this.isMultiLine() || row !== this.start.row ? this.start.row > row ? -1 : row > this.end.row ? 1 : this.start.row === row ? column >= this.start.column ? 0 : -1 : this.end.row === row ? this.end.column >= column ? 0 : 1 : 0 : this.start.column > column ? -1 : column > this.end.column ? 1 : 0
}, this.compareStart = function(row, column) {
return this.start.row == row && this.start.column == column ? -1 : this.compare(row, column)
}, this.compareEnd = function(row, column) {
return this.end.row == row && this.end.column == column ? 1 : this.compare(row, column)
}, this.compareInside = function(row, column) {
return this.end.row == row && this.end.column == column ? 1 : this.start.row == row && this.start.column == column ? -1 : this.compare(row, column)
}, this.clipRows = function(firstRow, lastRow) {
if (this.end.row > lastRow) var end = {
row: lastRow + 1,
column: 0
};
else if (firstRow > this.end.row) var end = {
row: firstRow,
column: 0
};
if (this.start.row > lastRow) var start = {
row: lastRow + 1,
column: 0
};
else if (firstRow > this.start.row) var start = {
row: firstRow,
column: 0
};
return Range.fromPoints(start || this.start, end || this.end)
}, this.extend = function(row, column) {
var cmp = this.compare(row, column);
if (0 == cmp) return this;
if (-1 == cmp) var start = {
row: row,
column: column
};
else var end = {
row: row,
column: column
};
return Range.fromPoints(start || this.start, end || this.end)
}, this.isEmpty = function() {
return this.start.row === this.end.row && this.start.column === this.end.column
}, this.isMultiLine = function() {
return this.start.row !== this.end.row
}, this.clone = function() {
return Range.fromPoints(this.start, this.end)
}, this.collapseRows = function() {
return 0 == this.end.column ? new Range(this.start.row, 0, Math.max(this.start.row, this.end.row - 1), 0) : new Range(this.start.row, 0, this.end.row, 0)
}, this.toScreenRange = function(session) {
var screenPosStart = session.documentToScreenPosition(this.start),
screenPosEnd = session.documentToScreenPosition(this.end);
return new Range(screenPosStart.row, screenPosStart.column, screenPosEnd.row, screenPosEnd.column)
}, this.moveBy = function(row, column) {
this.start.row += row, this.start.column += column, this.end.row += row, this.end.column += column
}