This commit is contained in:
Fabian Jakobs 2011-12-19 13:22:23 +01:00
commit 63e037f544
17 changed files with 75 additions and 60 deletions

View file

@ -10952,7 +10952,7 @@ var oop = require("../lib/oop");
function Mode() {
this.$tokenizer = new Tokenizer(new Rules().getRules());
this.$outdent = new Outdent();
this.foldingRules = new PythonFoldMode("\\[|=|(=>)|(->)");
this.foldingRules = new PythonFoldMode("=|=>|->|\\s*class [^#]*");
}
oop.inherits(Mode, TextMode);
@ -11289,7 +11289,7 @@ var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function(markers) {
this.foldingStartMarker = new RegExp("(?:(\\[)|" + markers + ")(?:\\s*)(?:#.*)?$");
this.foldingStartMarker = new RegExp("(?:([\\[{])|(" + markers + "))(?:\\s*)(?:#.*)?$");
};
oop.inherits(FoldMode, BaseFoldMode);
@ -11301,8 +11301,9 @@ oop.inherits(FoldMode, BaseFoldMode);
if (match) {
if (match[1])
return this.openingBracketBlock(session, match[1], row, match.index);
return this.indentationBlock(session, row, match.index + 1);
if (match[2])
return this.indentationBlock(session, row, match.index + match[2].length);
return this.indentationBlock(session, row);
}
}
@ -24349,12 +24350,14 @@ var VirtualRenderer = function(container, theme) {
var scrollLeft = this.scroller.scrollLeft;
if (scrollLeft > left) {
if (left < this.$padding + 2 * this.layerConfig.characterWidth)
left = 0;
this.scrollToX(left);
}
if (scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) {
if (left > this.layerConfig.width)
this.$desiredScrollLeft = left + 2 * this.characterWidth;
if (left > this.layerConfig.width + 2 * this.$padding)
this.$desiredScrollLeft = left;
else
this.scrollToX(Math.round(left + this.characterWidth - this.$size.scrollerWidth));
}
@ -24405,7 +24408,7 @@ var VirtualRenderer = function(container, theme) {
};
this.scrollToX = function(scrollLeft) {
if (scrollLeft <= this.$padding + 2 * this.layerConfig.characterWidth)
if (scrollLeft <= this.$padding)
scrollLeft = 0;
this.scroller.scrollLeft = scrollLeft;
@ -24884,10 +24887,11 @@ var Marker = function(parentEl) {
* Draws a multi line marker, where lines span the full width
*/
this.drawMultiLineMarker = function(stringBuilder, range, clazz, layerConfig, type) {
// from selection start to the end of the line
var padding = type === "background" ? 0 : this.$padding;
var layerWidth = layerConfig.width + 2 * this.$padding - padding;
// from selection start to the end of the line
var height = layerConfig.lineHeight;
var width = Math.round(layerConfig.width - (range.start.column * layerConfig.characterWidth));
var width = Math.round(layerWidth - (range.start.column * layerConfig.characterWidth));
var top = this.$getTop(range.start.row, layerConfig);
var left = Math.round(
padding + range.start.column * layerConfig.characterWidth
@ -24918,12 +24922,11 @@ var Marker = function(parentEl) {
if (height < 0)
return;
top = this.$getTop(range.start.row + 1, layerConfig);
width = layerConfig.width;
stringBuilder.push(
"<div class='", clazz, "' style='",
"height:", height, "px;",
"width:", width, "px;",
"width:", layerWidth, "px;",
"top:", top, "px;",
"left:", padding, "px;'></div>"
);

View file

@ -11,7 +11,7 @@
Ace
version 0.2.0
commit 1f40a1d21db4d499e3f3e1da80b5bc360b1fdad6
commit b8f15cb81bccbb33f7895991f35b52b3f8633815
-->

File diff suppressed because one or more lines are too long

View file

@ -12136,12 +12136,14 @@ var VirtualRenderer = function(container, theme) {
var scrollLeft = this.scroller.scrollLeft;
if (scrollLeft > left) {
if (left < this.$padding + 2 * this.layerConfig.characterWidth)
left = 0;
this.scrollToX(left);
}
if (scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) {
if (left > this.layerConfig.width)
this.$desiredScrollLeft = left + 2 * this.characterWidth;
if (left > this.layerConfig.width + 2 * this.$padding)
this.$desiredScrollLeft = left;
else
this.scrollToX(Math.round(left + this.characterWidth - this.$size.scrollerWidth));
}
@ -12192,7 +12194,7 @@ var VirtualRenderer = function(container, theme) {
};
this.scrollToX = function(scrollLeft) {
if (scrollLeft <= this.$padding + 2 * this.layerConfig.characterWidth)
if (scrollLeft <= this.$padding)
scrollLeft = 0;
this.scroller.scrollLeft = scrollLeft;
@ -12671,10 +12673,11 @@ var Marker = function(parentEl) {
* Draws a multi line marker, where lines span the full width
*/
this.drawMultiLineMarker = function(stringBuilder, range, clazz, layerConfig, type) {
// from selection start to the end of the line
var padding = type === "background" ? 0 : this.$padding;
var layerWidth = layerConfig.width + 2 * this.$padding - padding;
// from selection start to the end of the line
var height = layerConfig.lineHeight;
var width = Math.round(layerConfig.width - (range.start.column * layerConfig.characterWidth));
var width = Math.round(layerWidth - (range.start.column * layerConfig.characterWidth));
var top = this.$getTop(range.start.row, layerConfig);
var left = Math.round(
padding + range.start.column * layerConfig.characterWidth
@ -12705,12 +12708,11 @@ var Marker = function(parentEl) {
if (height < 0)
return;
top = this.$getTop(range.start.row + 1, layerConfig);
width = layerConfig.width;
stringBuilder.push(
"<div class='", clazz, "' style='",
"height:", height, "px;",
"width:", width, "px;",
"width:", layerWidth, "px;",
"top:", top, "px;",
"left:", padding, "px;'></div>"
);

View file

@ -12136,12 +12136,14 @@ var VirtualRenderer = function(container, theme) {
var scrollLeft = this.scroller.scrollLeft;
if (scrollLeft > left) {
if (left < this.$padding + 2 * this.layerConfig.characterWidth)
left = 0;
this.scrollToX(left);
}
if (scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) {
if (left > this.layerConfig.width)
this.$desiredScrollLeft = left + 2 * this.characterWidth;
if (left > this.layerConfig.width + 2 * this.$padding)
this.$desiredScrollLeft = left;
else
this.scrollToX(Math.round(left + this.characterWidth - this.$size.scrollerWidth));
}
@ -12192,7 +12194,7 @@ var VirtualRenderer = function(container, theme) {
};
this.scrollToX = function(scrollLeft) {
if (scrollLeft <= this.$padding + 2 * this.layerConfig.characterWidth)
if (scrollLeft <= this.$padding)
scrollLeft = 0;
this.scroller.scrollLeft = scrollLeft;
@ -12671,10 +12673,11 @@ var Marker = function(parentEl) {
* Draws a multi line marker, where lines span the full width
*/
this.drawMultiLineMarker = function(stringBuilder, range, clazz, layerConfig, type) {
// from selection start to the end of the line
var padding = type === "background" ? 0 : this.$padding;
var layerWidth = layerConfig.width + 2 * this.$padding - padding;
// from selection start to the end of the line
var height = layerConfig.lineHeight;
var width = Math.round(layerConfig.width - (range.start.column * layerConfig.characterWidth));
var width = Math.round(layerWidth - (range.start.column * layerConfig.characterWidth));
var top = this.$getTop(range.start.row, layerConfig);
var left = Math.round(
padding + range.start.column * layerConfig.characterWidth
@ -12705,12 +12708,11 @@ var Marker = function(parentEl) {
if (height < 0)
return;
top = this.$getTop(range.start.row + 1, layerConfig);
width = layerConfig.width;
stringBuilder.push(
"<div class='", clazz, "' style='",
"height:", height, "px;",
"width:", width, "px;",
"width:", layerWidth, "px;",
"top:", top, "px;",
"left:", padding, "px;'></div>"
);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -49,7 +49,7 @@ var oop = require("../lib/oop");
function Mode() {
this.$tokenizer = new Tokenizer(new Rules().getRules());
this.$outdent = new Outdent();
this.foldingRules = new PythonFoldMode("\\[|=|(=>)|(->)");
this.foldingRules = new PythonFoldMode("=|=>|->|\\s*class [^#]*");
}
oop.inherits(Mode, TextMode);
@ -466,7 +466,7 @@ var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function(markers) {
this.foldingStartMarker = new RegExp("(?:(\\[)|" + markers + ")(?:\\s*)(?:#.*)?$");
this.foldingStartMarker = new RegExp("(?:([\\[{])|(" + markers + "))(?:\\s*)(?:#.*)?$");
};
oop.inherits(FoldMode, BaseFoldMode);
@ -478,8 +478,9 @@ oop.inherits(FoldMode, BaseFoldMode);
if (match) {
if (match[1])
return this.openingBracketBlock(session, match[1], row, match.index);
return this.indentationBlock(session, row, match.index + 1);
if (match[2])
return this.indentationBlock(session, row, match.index + match[2].length);
return this.indentationBlock(session, row);
}
}

View file

@ -49,7 +49,7 @@ var oop = require("../lib/oop");
function Mode() {
this.$tokenizer = new Tokenizer(new Rules().getRules());
this.$outdent = new Outdent();
this.foldingRules = new PythonFoldMode("\\[|=|(=>)|(->)");
this.foldingRules = new PythonFoldMode("=|=>|->|\\s*class [^#]*");
}
oop.inherits(Mode, TextMode);
@ -466,7 +466,7 @@ var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function(markers) {
this.foldingStartMarker = new RegExp("(?:(\\[)|" + markers + ")(?:\\s*)(?:#.*)?$");
this.foldingStartMarker = new RegExp("(?:([\\[{])|(" + markers + "))(?:\\s*)(?:#.*)?$");
};
oop.inherits(FoldMode, BaseFoldMode);
@ -478,8 +478,9 @@ oop.inherits(FoldMode, BaseFoldMode);
if (match) {
if (match[1])
return this.openingBracketBlock(session, match[1], row, match.index);
return this.indentationBlock(session, row, match.index + 1);
if (match[2])
return this.indentationBlock(session, row, match.index + match[2].length);
return this.indentationBlock(session, row);
}
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View file

@ -368,7 +368,7 @@ var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function(markers) {
this.foldingStartMarker = new RegExp("(?:(\\[)|" + markers + ")(?:\\s*)(?:#.*)?$");
this.foldingStartMarker = new RegExp("(?:([\\[{])|(" + markers + "))(?:\\s*)(?:#.*)?$");
};
oop.inherits(FoldMode, BaseFoldMode);
@ -380,8 +380,9 @@ oop.inherits(FoldMode, BaseFoldMode);
if (match) {
if (match[1])
return this.openingBracketBlock(session, match[1], row, match.index);
return this.indentationBlock(session, row, match.index + 1);
if (match[2])
return this.indentationBlock(session, row, match.index + match[2].length);
return this.indentationBlock(session, row);
}
}

View file

@ -368,7 +368,7 @@ var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function(markers) {
this.foldingStartMarker = new RegExp("(?:(\\[)|" + markers + ")(?:\\s*)(?:#.*)?$");
this.foldingStartMarker = new RegExp("(?:([\\[{])|(" + markers + "))(?:\\s*)(?:#.*)?$");
};
oop.inherits(FoldMode, BaseFoldMode);
@ -380,8 +380,9 @@ oop.inherits(FoldMode, BaseFoldMode);
if (match) {
if (match[1])
return this.openingBracketBlock(session, match[1], row, match.index);
return this.indentationBlock(session, row, match.index + 1);
if (match[2])
return this.indentationBlock(session, row, match.index + match[2].length);
return this.indentationBlock(session, row);
}
}

File diff suppressed because one or more lines are too long

View file

@ -12701,12 +12701,14 @@ var VirtualRenderer = function(container, theme) {
var scrollLeft = this.scroller.scrollLeft;
if (scrollLeft > left) {
if (left < this.$padding + 2 * this.layerConfig.characterWidth)
left = 0;
this.scrollToX(left);
}
if (scrollLeft + this.$size.scrollerWidth < left + this.characterWidth) {
if (left > this.layerConfig.width)
this.$desiredScrollLeft = left + 2 * this.characterWidth;
if (left > this.layerConfig.width + 2 * this.$padding)
this.$desiredScrollLeft = left;
else
this.scrollToX(Math.round(left + this.characterWidth - this.$size.scrollerWidth));
}
@ -12757,7 +12759,7 @@ var VirtualRenderer = function(container, theme) {
};
this.scrollToX = function(scrollLeft) {
if (scrollLeft <= this.$padding + 2 * this.layerConfig.characterWidth)
if (scrollLeft <= this.$padding)
scrollLeft = 0;
this.scroller.scrollLeft = scrollLeft;
@ -13236,10 +13238,11 @@ var Marker = function(parentEl) {
* Draws a multi line marker, where lines span the full width
*/
this.drawMultiLineMarker = function(stringBuilder, range, clazz, layerConfig, type) {
// from selection start to the end of the line
var padding = type === "background" ? 0 : this.$padding;
var layerWidth = layerConfig.width + 2 * this.$padding - padding;
// from selection start to the end of the line
var height = layerConfig.lineHeight;
var width = Math.round(layerConfig.width - (range.start.column * layerConfig.characterWidth));
var width = Math.round(layerWidth - (range.start.column * layerConfig.characterWidth));
var top = this.$getTop(range.start.row, layerConfig);
var left = Math.round(
padding + range.start.column * layerConfig.characterWidth
@ -13270,12 +13273,11 @@ var Marker = function(parentEl) {
if (height < 0)
return;
top = this.$getTop(range.start.row + 1, layerConfig);
width = layerConfig.width;
stringBuilder.push(
"<div class='", clazz, "' style='",
"height:", height, "px;",
"width:", width, "px;",
"width:", layerWidth, "px;",
"top:", top, "px;",
"left:", padding, "px;'></div>"
);

View file

@ -49,7 +49,7 @@ var oop = require("../lib/oop");
function Mode() {
this.$tokenizer = new Tokenizer(new Rules().getRules());
this.$outdent = new Outdent();
this.foldingRules = new PythonFoldMode("\\[|=|(=>)|(->)");
this.foldingRules = new PythonFoldMode("=|=>|->|\\s*class [^#]*");
}
oop.inherits(Mode, TextMode);
@ -466,7 +466,7 @@ var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function(markers) {
this.foldingStartMarker = new RegExp("(?:(\\[)|" + markers + ")(?:\\s*)(?:#.*)?$");
this.foldingStartMarker = new RegExp("(?:([\\[{])|(" + markers + "))(?:\\s*)(?:#.*)?$");
};
oop.inherits(FoldMode, BaseFoldMode);
@ -478,8 +478,9 @@ oop.inherits(FoldMode, BaseFoldMode);
if (match) {
if (match[1])
return this.openingBracketBlock(session, match[1], row, match.index);
return this.indentationBlock(session, row, match.index + 1);
if (match[2])
return this.indentationBlock(session, row, match.index + match[2].length);
return this.indentationBlock(session, row);
}
}

View file

@ -368,7 +368,7 @@ var oop = require("../../lib/oop");
var BaseFoldMode = require("./fold_mode").FoldMode;
var FoldMode = exports.FoldMode = function(markers) {
this.foldingStartMarker = new RegExp("(?:(\\[)|" + markers + ")(?:\\s*)(?:#.*)?$");
this.foldingStartMarker = new RegExp("(?:([\\[{])|(" + markers + "))(?:\\s*)(?:#.*)?$");
};
oop.inherits(FoldMode, BaseFoldMode);
@ -380,8 +380,9 @@ oop.inherits(FoldMode, BaseFoldMode);
if (match) {
if (match[1])
return this.openingBracketBlock(session, match[1], row, match.index);
return this.indentationBlock(session, row, match.index + 1);
if (match[2])
return this.indentationBlock(session, row, match.index + match[2].length);
return this.indentationBlock(session, row);
}
}