wrapped line rendering fixes from ace

pull/495/head
nightwing 2018-04-17 16:54:57 +04:00
rodzic 63b1a96b96
commit f3dbec7b88
2 zmienionych plików z 13 dodań i 2 usunięć

Wyświetl plik

@ -195,6 +195,7 @@ var Text = function(parentEl) {
lineElementsIdx ++;
}
var heightChanged = false;
var row = first;
var foldLine = this.session.getNextFoldLine(row);
var foldStart = foldLine ? foldLine.start.row : Infinity;
@ -214,10 +215,20 @@ var Text = function(parentEl) {
this.$renderLine(
lineElement, row, row == foldStart ? foldLine : false
);
lineElement.style.height = (config.lineHeight * this.session.getRowLength(row)) + "px";
var height = (config.lineHeight * this.session.getRowLength(row)) + "px";
if (lineElement.style.height != height) {
heightChanged = true;
lineElement.style.height = height;
}
}
row++;
}
if (heightChanged) {
while (lineElementsIdx < this.$lines.cells.length) {
var cell = this.$lines.cells[lineElementsIdx++];
cell.element.style.top = this.$lines.computeLineTop(cell.row, config, this.session) + "px";
}
}
};
this.scrollLines = function(config) {

Wyświetl plik

@ -885,7 +885,7 @@ var VirtualRenderer = function(container, theme) {
this.$textLayer.scrollLines(config);
if (this.$showGutter) {
if (changes & this.CHANGE_GUTTER)
if (changes & this.CHANGE_GUTTER || changes & this.CHANGE_LINES)
this.$gutterLayer.update(config);
else
this.$gutterLayer.scrollLines(config);