make gutter resizing faster

This commit is contained in:
nightwing 2012-12-09 18:36:01 +04:00
commit c68bed51e0

View file

@ -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.