do not store copy of breakpoints array in gutter
This commit is contained in:
parent
b3ffdeda6e
commit
31729a963a
4 changed files with 7 additions and 12 deletions
|
|
@ -570,7 +570,7 @@ var Editor = function(renderer, session) {
|
||||||
* Emitted when a breakpoint changes.
|
* Emitted when a breakpoint changes.
|
||||||
**/
|
**/
|
||||||
this.onChangeBreakpoint = function() {
|
this.onChangeBreakpoint = function() {
|
||||||
this.renderer.setBreakpoints(this.session.getBreakpoints());
|
this.renderer.updateBreakpoints();
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
|
|
@ -75,10 +75,6 @@ var Gutter = function(parentEl) {
|
||||||
this.$decorations[row] = (this.$decorations[row] || "").replace(" " + className, "");
|
this.$decorations[row] = (this.$decorations[row] || "").replace(" " + className, "");
|
||||||
};
|
};
|
||||||
|
|
||||||
this.setBreakpoints = function(rows) {
|
|
||||||
this.$breakpoints = rows.concat();
|
|
||||||
};
|
|
||||||
|
|
||||||
this.setAnnotations = function(annotations) {
|
this.setAnnotations = function(annotations) {
|
||||||
// iterate over sparse array
|
// iterate over sparse array
|
||||||
this.$annotations = [];
|
this.$annotations = [];
|
||||||
|
|
@ -116,6 +112,7 @@ var Gutter = function(parentEl) {
|
||||||
var fold = this.session.getNextFoldLine(i);
|
var fold = this.session.getNextFoldLine(i);
|
||||||
var foldStart = fold ? fold.start.row : Infinity;
|
var foldStart = fold ? fold.start.row : Infinity;
|
||||||
var foldWidgets = this.$showFoldWidgets && this.session.foldWidgets;
|
var foldWidgets = this.$showFoldWidgets && this.session.foldWidgets;
|
||||||
|
var breakpoints = this.session.$breakpoints;
|
||||||
|
|
||||||
while (true) {
|
while (true) {
|
||||||
if(i > foldStart) {
|
if(i > foldStart) {
|
||||||
|
|
@ -129,7 +126,7 @@ var Gutter = function(parentEl) {
|
||||||
var annotation = this.$annotations[i] || emptyAnno;
|
var annotation = this.$annotations[i] || emptyAnno;
|
||||||
html.push("<div class='ace_gutter-cell",
|
html.push("<div class='ace_gutter-cell",
|
||||||
this.$decorations[i] || "",
|
this.$decorations[i] || "",
|
||||||
this.$breakpoints[i] ? " ace_breakpoint " : " ",
|
breakpoints[i] ? " ace_breakpoint " : " ",
|
||||||
annotation.className,
|
annotation.className,
|
||||||
"' title='", annotation.text.join("\n"),
|
"' title='", annotation.text.join("\n"),
|
||||||
"' style='height:", this.session.getRowLength(i) * config.lineHeight, "px;'>", (i+1));
|
"' style='height:", this.session.getRowLength(i) * config.lineHeight, "px;'>", (i+1));
|
||||||
|
|
|
||||||
|
|
@ -163,7 +163,7 @@ MockRenderer.prototype.updateBackMarkers = function() {
|
||||||
MockRenderer.prototype.updateFrontMarkers = function() {
|
MockRenderer.prototype.updateFrontMarkers = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
MockRenderer.prototype.setBreakpoints = function() {
|
MockRenderer.prototype.updateBreakpoints = function() {
|
||||||
};
|
};
|
||||||
|
|
||||||
MockRenderer.prototype.onResize = function() {
|
MockRenderer.prototype.onResize = function() {
|
||||||
|
|
|
||||||
|
|
@ -889,13 +889,11 @@ var VirtualRenderer = function(container, theme) {
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* VirtualRenderer.setBreakpoints(rows) -> Void
|
* VirtualRenderer.updateBreakpoints() -> Void
|
||||||
* - rows (Array): An array containg row numbers
|
|
||||||
*
|
*
|
||||||
* Sets a breakpoint for every row number indicated on `rows`.
|
* Redraw breakpoints.
|
||||||
**/
|
**/
|
||||||
this.setBreakpoints = function(rows) {
|
this.updateBreakpoints = function(rows) {
|
||||||
this.$gutterLayer.setBreakpoints(rows);
|
|
||||||
this.$loop.schedule(this.CHANGE_GUTTER);
|
this.$loop.schedule(this.CHANGE_GUTTER);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue