Ensure selection can't be inside of a fold.
This commit is contained in:
parent
5573252193
commit
e356ea8cae
1 changed files with 6 additions and 0 deletions
|
|
@ -443,6 +443,12 @@ var Selection = function(session) {
|
||||||
};
|
};
|
||||||
|
|
||||||
this.moveCursorTo = function(row, column, preventUpdateDesiredColumn) {
|
this.moveCursorTo = function(row, column, preventUpdateDesiredColumn) {
|
||||||
|
// Ensure the row/column is not inside of a fold.
|
||||||
|
var fold = this.session.getFoldAt(row, column, 1);
|
||||||
|
if (fold) {
|
||||||
|
row = fold.start.row;
|
||||||
|
column = fold.start.column;
|
||||||
|
}
|
||||||
this.selectionLead.setPosition(row, column);
|
this.selectionLead.setPosition(row, column);
|
||||||
if (!preventUpdateDesiredColumn)
|
if (!preventUpdateDesiredColumn)
|
||||||
this.$updateDesiredColumn(this.selectionLead.column);
|
this.$updateDesiredColumn(this.selectionLead.column);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue