fix typo
This commit is contained in:
parent
a3f61f711a
commit
299cdc1b19
2 changed files with 22 additions and 2 deletions
|
|
@ -714,7 +714,7 @@ function Folding() {
|
||||||
// sometimes singleline folds can be missed by the code above
|
// sometimes singleline folds can be missed by the code above
|
||||||
if (!range.isMultiLine()) {
|
if (!range.isMultiLine()) {
|
||||||
fold = this.getFoldAt(range.start.row, range.start.column, 1);
|
fold = this.getFoldAt(range.start.row, range.start.column, 1);
|
||||||
if (fold && range.isEequal(fold.range)) {
|
if (fold && range.isEqual(fold.range)) {
|
||||||
this.removeFold(fold);
|
this.removeFold(fold);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -51,7 +51,7 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
|
||||||
};
|
};
|
||||||
|
|
||||||
(function() {
|
(function() {
|
||||||
this.isEequal = function(range) {
|
this.isEqual = function(range) {
|
||||||
return this.start.row == range.start.row &&
|
return this.start.row == range.start.row &&
|
||||||
this.end.row == range.end.row &&
|
this.end.row == range.end.row &&
|
||||||
this.start.column == range.start.column &&
|
this.start.column == range.start.column &&
|
||||||
|
|
@ -117,6 +117,11 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
|
||||||
return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
|
return this.comparePoint(range.start) == 0 && this.comparePoint(range.end) == 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.intersectsRange = function(range) {
|
||||||
|
var cmp = this.compareRange(range);
|
||||||
|
return (cmp == -1 || cmp == 0 || cmp == 1);
|
||||||
|
}
|
||||||
|
|
||||||
this.isEnd = function(row, column) {
|
this.isEnd = function(row, column) {
|
||||||
return this.end.row == row && this.end.column == column;
|
return this.end.row == row && this.end.column == column;
|
||||||
}
|
}
|
||||||
|
|
@ -276,6 +281,21 @@ var Range = function(startRow, startColumn, endRow, endColumn) {
|
||||||
return Range.fromPoints(start || this.start, end || this.end);
|
return Range.fromPoints(start || this.start, end || this.end);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.fixOrientation = function() {
|
||||||
|
if (
|
||||||
|
this.start.row < this.end.row
|
||||||
|
|| (this.start.row == this.end.row && this.start.column < this.end.column)
|
||||||
|
) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
var temp = this.start;
|
||||||
|
this.end = this.start;
|
||||||
|
this.start = temp;
|
||||||
|
return true;
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
this.isEmpty = function() {
|
this.isEmpty = function() {
|
||||||
return (this.start.row == this.end.row && this.start.column == this.end.column);
|
return (this.start.row == this.end.row && this.start.column == this.end.column);
|
||||||
};
|
};
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue