unclutter gutter and fix sizing

This commit is contained in:
nightwing 2012-05-11 16:19:30 +04:00
commit 2502f319f4

View file

@ -72,7 +72,7 @@ var Gutter = function(parentEl) {
};
this.removeGutterDecoration = function(row, className){
this.$decorations[row] = this.$decorations[row].replace(" " + className, "");
this.$decorations[row] = (this.$decorations[row] || "").replace(" " + className, "");
};
this.setBreakpoints = function(rows) {
@ -132,7 +132,7 @@ var Gutter = function(parentEl) {
this.$breakpoints[i] ? " ace_breakpoint " : " ",
annotation.className,
"' title='", annotation.text.join("\n"),
"' style='height:", config.lineHeight, "px;'>", (i+1));
"' style='height:", this.session.getRowLength(i) * config.lineHeight, "px;'>", (i+1));
if (foldWidgets) {
var c = foldWidgets[i];
@ -147,15 +147,18 @@ var Gutter = function(parentEl) {
);
}
var wrappedRowLength = this.session.getRowLength(i) - 1;
while (wrappedRowLength--) {
html.push("</div><div class='ace_gutter-cell' style='height:", config.lineHeight, "px'>\xA6");
}
html.push("</div>");
i++;
}
if (this.session.$useWrapMode)
html.push(
"<div class='ace_gutter-cell' style='pointer-events:none;opacity:0'>",
this.session.getLength() - 1,
"</div>"
);
this.element = dom.setInnerHtml(this.element, html.join(""));
this.element.style.height = config.minHeight + "px";