revert acc3faf42c since it was not working with folding enabled
This commit is contained in:
parent
22ee0d0bc8
commit
0e5b77763f
2 changed files with 25 additions and 30 deletions
|
|
@ -27,6 +27,12 @@
|
||||||
z-index: 4;
|
z-index: 4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.ace_gutter_active_line {
|
||||||
|
position: absolute;
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
}
|
||||||
|
|
||||||
.ace_scroller.horscroll {
|
.ace_scroller.horscroll {
|
||||||
box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;
|
box-shadow: 17px 0 16px -16px rgba(0, 0, 0, 0.4) inset;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -102,6 +102,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
this.content.className = "ace_content";
|
this.content.className = "ace_content";
|
||||||
this.scroller.appendChild(this.content);
|
this.scroller.appendChild(this.content);
|
||||||
|
|
||||||
|
this.setHighlightGutterLine(true);
|
||||||
this.$gutterLayer = new GutterLayer(this.$gutter);
|
this.$gutterLayer = new GutterLayer(this.$gutter);
|
||||||
this.$gutterLayer.on("changeGutterWidth", this.onResize.bind(this, true));
|
this.$gutterLayer.on("changeGutterWidth", this.onResize.bind(this, true));
|
||||||
this.setFadeFoldWidgets(true);
|
this.setFadeFoldWidgets(true);
|
||||||
|
|
@ -468,38 +469,30 @@ var VirtualRenderer = function(container, theme) {
|
||||||
dom.removeCssClass(this.$gutter, "ace_fade-fold-widgets");
|
dom.removeCssClass(this.$gutter, "ace_fade-fold-widgets");
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$highlightGutterLine = true;
|
this.$highlightGutterLine = false;
|
||||||
this.setHighlightGutterLine = function(shouldHighlight) {
|
this.setHighlightGutterLine = function(shouldHighlight) {
|
||||||
if (this.$highlightGutterLine == shouldHighlight)
|
if (this.$highlightGutterLine == shouldHighlight)
|
||||||
return;
|
return;
|
||||||
this.$highlightGutterLine = shouldHighlight;
|
this.$highlightGutterLine = shouldHighlight;
|
||||||
|
|
||||||
this.$loop.schedule(this.CHANGE_GUTTER);
|
if (!this.$gutterLineHighlight) {
|
||||||
|
this.$gutterLineHighlight = dom.createElement("div");
|
||||||
|
this.$gutterLineHighlight.className = "ace_gutter_active_line";
|
||||||
|
this.$gutter.appendChild(this.$gutterLineHighlight);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.$gutterLineHighlight.style.display = shouldHighlight ? "" : "none";
|
||||||
|
this.$updateGutterLineHighlight();
|
||||||
};
|
};
|
||||||
|
|
||||||
this.getHighlightGutterLine = function() {
|
this.getHighlightGutterLine = function() {
|
||||||
return this.$highlightGutterLine;
|
return this.$highlightGutterLine;
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$updateGutterLineHighlight = function(gutterReady) {
|
this.$updateGutterLineHighlight = function() {
|
||||||
var i = this.session.selection.lead.row;
|
this.$gutterLineHighlight.style.top = this.$cursorLayer.$pixelPos.top - this.layerConfig.offset + "px";
|
||||||
if (i == this.$gutterLineHighlight)
|
this.$gutterLineHighlight.style.height = this.layerConfig.lineHeight + "px";
|
||||||
return;
|
|
||||||
|
|
||||||
if (!gutterReady) {
|
|
||||||
var lineEl, ch = this.$gutterLayer.element.children;
|
|
||||||
var index = this.$gutterLineHighlight - this.layerConfig.firstRow;
|
|
||||||
if (index >= 0 && (lineEl = ch[index]))
|
|
||||||
dom.removeCssClass(lineEl, "ace_gutter_active_line");
|
|
||||||
|
|
||||||
index = i - this.layerConfig.firstRow;
|
|
||||||
if (index >= 0 && (lineEl = ch[index]))
|
|
||||||
dom.addCssClass(lineEl, "ace_gutter_active_line");
|
|
||||||
}
|
|
||||||
|
|
||||||
this.$gutterLayer.removeGutterDecoration(this.$gutterLineHighlight, "ace_gutter_active_line");
|
|
||||||
this.$gutterLayer.addGutterDecoration(i, "ace_gutter_active_line");
|
|
||||||
this.$gutterLineHighlight = i;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
this.$updatePrintMargin = function() {
|
this.$updatePrintMargin = function() {
|
||||||
|
|
@ -693,15 +686,13 @@ var VirtualRenderer = function(container, theme) {
|
||||||
// update scrollbar first to not lose scroll position when gutter calls resize
|
// update scrollbar first to not lose scroll position when gutter calls resize
|
||||||
this.$updateScrollBar();
|
this.$updateScrollBar();
|
||||||
this.$textLayer.update(this.layerConfig);
|
this.$textLayer.update(this.layerConfig);
|
||||||
if (this.showGutter) {
|
if (this.showGutter)
|
||||||
if (this.$highlightGutterLine)
|
|
||||||
this.$updateGutterLineHighlight(true);
|
|
||||||
this.$gutterLayer.update(this.layerConfig);
|
this.$gutterLayer.update(this.layerConfig);
|
||||||
}
|
|
||||||
this.$markerBack.update(this.layerConfig);
|
this.$markerBack.update(this.layerConfig);
|
||||||
this.$markerFront.update(this.layerConfig);
|
this.$markerFront.update(this.layerConfig);
|
||||||
this.$cursorLayer.update(this.layerConfig);
|
this.$cursorLayer.update(this.layerConfig);
|
||||||
this.$moveTextAreaToCursor();
|
this.$moveTextAreaToCursor();
|
||||||
|
this.$highlightGutterLine && this.$updateGutterLineHighlight();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -713,15 +704,13 @@ var VirtualRenderer = function(container, theme) {
|
||||||
else
|
else
|
||||||
this.$textLayer.scrollLines(this.layerConfig);
|
this.$textLayer.scrollLines(this.layerConfig);
|
||||||
|
|
||||||
if (this.showGutter) {
|
if (this.showGutter)
|
||||||
if (this.$highlightGutterLine)
|
|
||||||
this.$updateGutterLineHighlight(true);
|
|
||||||
this.$gutterLayer.update(this.layerConfig);
|
this.$gutterLayer.update(this.layerConfig);
|
||||||
}
|
|
||||||
this.$markerBack.update(this.layerConfig);
|
this.$markerBack.update(this.layerConfig);
|
||||||
this.$markerFront.update(this.layerConfig);
|
this.$markerFront.update(this.layerConfig);
|
||||||
this.$cursorLayer.update(this.layerConfig);
|
this.$cursorLayer.update(this.layerConfig);
|
||||||
this.$moveTextAreaToCursor();
|
this.$moveTextAreaToCursor();
|
||||||
|
this.$highlightGutterLine && this.$updateGutterLineHighlight();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -744,7 +733,7 @@ var VirtualRenderer = function(container, theme) {
|
||||||
if (changes & this.CHANGE_CURSOR) {
|
if (changes & this.CHANGE_CURSOR) {
|
||||||
this.$cursorLayer.update(this.layerConfig);
|
this.$cursorLayer.update(this.layerConfig);
|
||||||
this.$moveTextAreaToCursor();
|
this.$moveTextAreaToCursor();
|
||||||
this.$highlightGutterLine && this.$updateGutterLineHighlight(false);
|
this.$highlightGutterLine && this.$updateGutterLineHighlight();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_FRONT)) {
|
if (changes & (this.CHANGE_MARKER | this.CHANGE_MARKER_FRONT)) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue