This commit is contained in:
Fabian Jakobs 2011-12-09 16:45:19 +01:00
commit e1b21b0dc8
43 changed files with 71 additions and 53 deletions

View file

@ -8012,7 +8012,7 @@ function Folding() {
token = iterator.stepBackward(); token = iterator.stepBackward();
range.end.row = iterator.getCurrentTokenRow(); range.end.row = iterator.getCurrentTokenRow();
range.end.column = iterator.getCurrentTokenColumn() + token.value.length - 1; range.end.column = iterator.getCurrentTokenColumn() + token.value.length;
return range; return range;
} }
}; };
@ -8574,8 +8574,10 @@ var TokenIterator = function(session, initialRow, initialColumn) {
while (this.$tokenIndex < 0) { while (this.$tokenIndex < 0) {
this.$row -= 1; this.$row -= 1;
if (this.$row < 0) if (this.$row < 0) {
this.$row = 0;
return null; return null;
}
this.$rowTokens = this.$session.getTokens(this.$row, this.$row)[0].tokens; this.$rowTokens = this.$session.getTokens(this.$row, this.$row)[0].tokens;
this.$tokenIndex = this.$rowTokens.length - 1; this.$tokenIndex = this.$rowTokens.length - 1;
@ -8590,8 +8592,10 @@ var TokenIterator = function(session, initialRow, initialColumn) {
while (this.$tokenIndex >= this.$rowTokens.length) { while (this.$tokenIndex >= this.$rowTokens.length) {
this.$row += 1; this.$row += 1;
if (this.$row >= rowCount) if (this.$row >= rowCount) {
this.$row = rowCount - 1;
return null; return null;
}
this.$rowTokens = this.$session.getTokens(this.$row, this.$row)[0].tokens; this.$rowTokens = this.$session.getTokens(this.$row, this.$row)[0].tokens;
this.$tokenIndex = 0; this.$tokenIndex = 0;
@ -10322,8 +10326,11 @@ oop.inherits(FoldMode, BaseFoldMode);
if (match) { if (match) {
var i = match.index; var i = match.index;
if (match[2]) if (match[2]) {
return session.getCommentFoldRange(row, i + match[0].length); var range = session.getCommentFoldRange(row, i + match[0].length);
range.end.column -= 2;
return range;
}
var start = {row: row, column: i+1}; var start = {row: row, column: i+1};
var end = session.$findClosingBracket(match[1], start); var end = session.$findClosingBracket(match[1], start);
@ -10348,8 +10355,11 @@ oop.inherits(FoldMode, BaseFoldMode);
if (match) { if (match) {
var i = match.index + match[0].length; var i = match.index + match[0].length;
if (match[2]) if (match[2]) {
return session.getCommentFoldRange(row, i); var range = session.getCommentFoldRange(row, i);
range.end.column -= 2;
return range;
}
var end = {row: row, column: i}; var end = {row: row, column: i};
var start = session.$findOpeningBracket(match[1], end); var start = session.$findOpeningBracket(match[1], end);

File diff suppressed because one or more lines are too long

View file

@ -11,7 +11,7 @@
Ace Ace
version 0.2.0 version 0.2.0
commit d12d7e3dc53b1215ab22eec98e978acab5d2f63b commit 83065ec8f5578ac34b02b51da46b4cada4213fa0
--> -->

View file

@ -9917,7 +9917,7 @@ function Folding() {
token = iterator.stepBackward(); token = iterator.stepBackward();
range.end.row = iterator.getCurrentTokenRow(); range.end.row = iterator.getCurrentTokenRow();
range.end.column = iterator.getCurrentTokenColumn() + token.value.length - 1; range.end.column = iterator.getCurrentTokenColumn() + token.value.length;
return range; return range;
} }
}; };
@ -10479,8 +10479,10 @@ var TokenIterator = function(session, initialRow, initialColumn) {
while (this.$tokenIndex < 0) { while (this.$tokenIndex < 0) {
this.$row -= 1; this.$row -= 1;
if (this.$row < 0) if (this.$row < 0) {
this.$row = 0;
return null; return null;
}
this.$rowTokens = this.$session.getTokens(this.$row, this.$row)[0].tokens; this.$rowTokens = this.$session.getTokens(this.$row, this.$row)[0].tokens;
this.$tokenIndex = this.$rowTokens.length - 1; this.$tokenIndex = this.$rowTokens.length - 1;
@ -10495,8 +10497,10 @@ var TokenIterator = function(session, initialRow, initialColumn) {
while (this.$tokenIndex >= this.$rowTokens.length) { while (this.$tokenIndex >= this.$rowTokens.length) {
this.$row += 1; this.$row += 1;
if (this.$row >= rowCount) if (this.$row >= rowCount) {
this.$row = rowCount - 1;
return null; return null;
}
this.$rowTokens = this.$session.getTokens(this.$row, this.$row)[0].tokens; this.$rowTokens = this.$session.getTokens(this.$row, this.$row)[0].tokens;
this.$tokenIndex = 0; this.$tokenIndex = 0;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -9911,7 +9911,7 @@ function Folding() {
token = iterator.stepBackward(); token = iterator.stepBackward();
range.end.row = iterator.getCurrentTokenRow(); range.end.row = iterator.getCurrentTokenRow();
range.end.column = iterator.getCurrentTokenColumn() + token.value.length - 1; range.end.column = iterator.getCurrentTokenColumn() + token.value.length;
return range; return range;
} }
}; };
@ -10473,8 +10473,10 @@ var TokenIterator = function(session, initialRow, initialColumn) {
while (this.$tokenIndex < 0) { while (this.$tokenIndex < 0) {
this.$row -= 1; this.$row -= 1;
if (this.$row < 0) if (this.$row < 0) {
this.$row = 0;
return null; return null;
}
this.$rowTokens = this.$session.getTokens(this.$row, this.$row)[0].tokens; this.$rowTokens = this.$session.getTokens(this.$row, this.$row)[0].tokens;
this.$tokenIndex = this.$rowTokens.length - 1; this.$tokenIndex = this.$rowTokens.length - 1;
@ -10489,8 +10491,10 @@ var TokenIterator = function(session, initialRow, initialColumn) {
while (this.$tokenIndex >= this.$rowTokens.length) { while (this.$tokenIndex >= this.$rowTokens.length) {
this.$row += 1; this.$row += 1;
if (this.$row >= rowCount) if (this.$row >= rowCount) {
this.$row = rowCount - 1;
return null; return null;
}
this.$rowTokens = this.$session.getTokens(this.$row, this.$row)[0].tokens; this.$rowTokens = this.$session.getTokens(this.$row, this.$row)[0].tokens;
this.$tokenIndex = 0; this.$tokenIndex = 0;

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long