in lib/ace/layer/gutter.js [303:378]
this.$renderCell = function(cell, config, fold, row) {
var element = cell.element;
var session = this.session;
var textNode = element.childNodes[0];
var foldWidget = element.childNodes[1];
var firstLineNumber = session.$firstLineNumber;
var breakpoints = session.$breakpoints;
var decorations = session.$decorations;
var gutterRenderer = session.gutterRenderer || this.$renderer;
var foldWidgets = this.$showFoldWidgets && session.foldWidgets;
var foldStart = fold ? fold.start.row : Number.MAX_VALUE;
var className = "ace_gutter-cell ";
if (this.$highlightGutterLine) {
if (row == this.$cursorRow || (fold && row < this.$cursorRow && row >= foldStart && this.$cursorRow <= fold.end.row)) {
className += "ace_gutter-active-line ";
if (this.$cursorCell != cell) {
if (this.$cursorCell)
this.$cursorCell.element.className = this.$cursorCell.element.className.replace("ace_gutter-active-line ", "");
this.$cursorCell = cell;
}
}
}
if (breakpoints[row])
className += breakpoints[row];
if (decorations[row])
className += decorations[row];
if (this.$annotations[row])
className += this.$annotations[row].className;
if (element.className != className)
element.className = className;
if (foldWidgets) {
var c = foldWidgets[row];
// check if cached value is invalidated and we need to recompute
if (c == null)
c = foldWidgets[row] = session.getFoldWidget(row);
}
if (c) {
var className = "ace_fold-widget ace_" + c;
if (c == "start" && row == foldStart && row < fold.end.row)
className += " ace_closed";
else
className += " ace_open";
if (foldWidget.className != className)
foldWidget.className = className;
var foldHeight = config.lineHeight + "px";
dom.setStyle(foldWidget.style, "height", foldHeight);
dom.setStyle(foldWidget.style, "display", "inline-block");
} else {
if (foldWidget) {
dom.setStyle(foldWidget.style, "display", "none");
}
}
var text = (gutterRenderer
? gutterRenderer.getText(session, row)
: row + firstLineNumber).toString();
if (text !== textNode.data) {
textNode.data = text;
}
dom.setStyle(cell.element.style, "height", this.$lines.computeLineHeight(row, config, session) + "px");
dom.setStyle(cell.element.style, "top", this.$lines.computeLineTop(row, config, session) + "px");
cell.text = text;
return cell;
};