Remove Fold.compare/contains functions. Rename Fold.sameLine to Fold.sameRow. Add new functions to Range that repalce the Fold.compare/contains functions but are more explicit on where to drop the start/end.
This commit is contained in:
parent
15d2c50117
commit
56f74f1368
3 changed files with 85 additions and 53 deletions
|
|
@ -265,7 +265,7 @@ var Selection = function(session) {
|
|||
var cursor = this.selectionLead.getPosition(),
|
||||
fold;
|
||||
|
||||
if (fold = this.session.getFoldAt(cursor.row, cursor.column, -1)) {
|
||||
if (fold = this.session.getFoldAt(cursor.row, cursor.column, 1)) {
|
||||
this.moveCursorTo(fold.start.row, fold.start.column);
|
||||
} else if (cursor.column == 0) {
|
||||
// cursor is a line (start
|
||||
|
|
@ -285,7 +285,7 @@ var Selection = function(session) {
|
|||
this.moveCursorRight = function() {
|
||||
var cursor = this.selectionLead.getPosition(),
|
||||
fold;
|
||||
if (fold = this.session.getFoldAt(cursor.row, cursor.column, 1)) {
|
||||
if (fold = this.session.getFoldAt(cursor.row, cursor.column, -1)) {
|
||||
this.moveCursorTo(fold.end.row, fold.end.column);
|
||||
} else if (this.selectionLead.column == this.doc.getLine(this.selectionLead.row).length) {
|
||||
if (this.selectionLead.row < this.doc.getLength() - 1) {
|
||||
|
|
@ -348,7 +348,7 @@ var Selection = function(session) {
|
|||
this.session.tokenRe.lastIndex = 0;
|
||||
|
||||
var fold;
|
||||
if (fold = this.session.getFoldAt(row, column, 1)) {
|
||||
if (fold = this.session.getFoldAt(row, column, -1)) {
|
||||
this.moveCursorTo(fold.end.row, fold.end.column);
|
||||
return;
|
||||
} else if (column == line.length) {
|
||||
|
|
@ -372,7 +372,7 @@ var Selection = function(session) {
|
|||
var column = this.selectionLead.column;
|
||||
|
||||
var fold;
|
||||
if (fold = this.session.getFoldAt(row, column, -1)) {
|
||||
if (fold = this.session.getFoldAt(row, column, 1)) {
|
||||
this.moveCursorTo(fold.start.row, fold.start.column);
|
||||
return;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue