add fixedWidthGutter option
This commit is contained in:
parent
b23265ad72
commit
244e1462e8
3 changed files with 10 additions and 1 deletions
|
|
@ -2385,6 +2385,7 @@ config.defineOptions(Editor.prototype, "editor", {
|
||||||
maxLines: "renderer",
|
maxLines: "renderer",
|
||||||
minLines: "renderer",
|
minLines: "renderer",
|
||||||
scrollPastEnd: "renderer",
|
scrollPastEnd: "renderer",
|
||||||
|
fixedWidthGutter: "renderer",
|
||||||
|
|
||||||
scrollSpeed: "$mouseHandler",
|
scrollSpeed: "$mouseHandler",
|
||||||
dragDelay: "$mouseHandler",
|
dragDelay: "$mouseHandler",
|
||||||
|
|
|
||||||
|
|
@ -168,7 +168,7 @@ var Gutter = function(parentEl) {
|
||||||
this.element = dom.setInnerHtml(this.element, html.join(""));
|
this.element = dom.setInnerHtml(this.element, html.join(""));
|
||||||
this.element.style.height = config.minHeight + "px";
|
this.element.style.height = config.minHeight + "px";
|
||||||
|
|
||||||
if (this.session.$useWrapMode)
|
if (this.$fixedWidth || this.session.$useWrapMode)
|
||||||
lastLineNumber = this.session.getLength();
|
lastLineNumber = this.session.getLength();
|
||||||
|
|
||||||
var gutterWidth = ("" + lastLineNumber).length * config.characterWidth;
|
var gutterWidth = ("" + lastLineNumber).length * config.characterWidth;
|
||||||
|
|
@ -181,6 +181,8 @@ var Gutter = function(parentEl) {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
this.$fixedWidth = false;
|
||||||
|
|
||||||
this.$showFoldWidgets = true;
|
this.$showFoldWidgets = true;
|
||||||
this.setShowFoldWidgets = function(show) {
|
this.setShowFoldWidgets = function(show) {
|
||||||
if (show)
|
if (show)
|
||||||
|
|
|
||||||
|
|
@ -1655,6 +1655,12 @@ config.defineOptions(VirtualRenderer.prototype, "renderer", {
|
||||||
},
|
},
|
||||||
initialValue: 0,
|
initialValue: 0,
|
||||||
handlesSet: true
|
handlesSet: true
|
||||||
|
},
|
||||||
|
fixedWidthGutter: {
|
||||||
|
set: function(val) {
|
||||||
|
this.gutterLayer.fixedWidth = !!val;
|
||||||
|
this.$loop.schedule(this.CHANGE_GUTTER);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue