make gutter resizing faster
This commit is contained in:
parent
b0bbb36923
commit
c68bed51e0
1 changed files with 11 additions and 1 deletions
|
|
@ -96,7 +96,7 @@ var VirtualRenderer = function(container, theme) {
|
|||
|
||||
this.setHighlightGutterLine(true);
|
||||
this.$gutterLayer = new GutterLayer(this.$gutter);
|
||||
this.$gutterLayer.on("changeGutterWidth", this.onResize.bind(this, true));
|
||||
this.$gutterLayer.on("changeGutterWidth", this.onGutterResize.bind(this));
|
||||
|
||||
this.$markerBack = new MarkerLayer(this.content);
|
||||
|
||||
|
|
@ -339,6 +339,16 @@ var VirtualRenderer = function(container, theme) {
|
|||
delete this.resizing;
|
||||
};
|
||||
|
||||
this.onGutterResize = function() {
|
||||
var width = this.$size.width;
|
||||
var gutterWidth = this.showGutter ? this.$gutter.offsetWidth : 0;
|
||||
this.scroller.style.left = gutterWidth + "px";
|
||||
this.$size.scrollerWidth = Math.max(0, width - gutterWidth - this.scrollBar.getWidth());
|
||||
|
||||
if (this.session.getUseWrapMode() && this.adjustWrapLimit())
|
||||
this.$loop.schedule(this.CHANGE_FULL);
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* Adjusts the wrap limit, which is the number of characters that can fit within the width of the edit area on screen.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue