diff --git a/lib/ace/commands/multi_select_commands.js b/lib/ace/commands/multi_select_commands.js index ed396fb3..ebac5cc7 100644 --- a/lib/ace/commands/multi_select_commands.js +++ b/lib/ace/commands/multi_select_commands.js @@ -92,7 +92,7 @@ exports.multiSelectCommands = [{ bindKey: "esc", exec: function(editor) { editor.exitMultiSelectMode(); }, readonly: true, - isAvailable: function(editor) {return editor.inMultiSelectMode} + isAvailable: function(editor) {return editor && editor.inMultiSelectMode} }]; var HashHandler = require("../keyboard/hash_handler").HashHandler; diff --git a/lib/ace/css/editor.css b/lib/ace/css/editor.css index 0a668fff..d53a135b 100644 --- a/lib/ace/css/editor.css +++ b/lib/ace/css/editor.css @@ -8,6 +8,7 @@ .ace_scroller { position: absolute; overflow: hidden; + width : 100%; } .ace_content { diff --git a/lib/ace/virtual_renderer.js b/lib/ace/virtual_renderer.js index 18408b98..c41d976a 100644 --- a/lib/ace/virtual_renderer.js +++ b/lib/ace/virtual_renderer.js @@ -263,8 +263,13 @@ var VirtualRenderer = function(container, theme) { * * Triggers a full update of all the layers, for all the rows. **/ - this.updateFull = function() { - this.$loop.schedule(this.CHANGE_FULL); + this.updateFull = function(force) { + if (force){ + this.$renderChanges(this.CHANGE_FULL, true); + } + else { + this.$loop.schedule(this.CHANGE_FULL); + } }; /** @@ -282,11 +287,19 @@ var VirtualRenderer = function(container, theme) { * * [Triggers a resize of the editor.]{: #VirtualRenderer.onResize} **/ - this.onResize = function(force) { + this.onResize = function(force, gutterWidth, width, height) { var changes = this.CHANGE_SIZE; var size = this.$size; - var height = dom.getInnerHeight(this.container); + if (this.resizing > 2) + return; + else if (this.resizing > 1) + this.resizing++; + else + this.resizing = force ? 1 : 0; + + if (!height) + height = dom.getInnerHeight(this.container); if (force || size.height != height) { size.height = height; @@ -300,20 +313,27 @@ var VirtualRenderer = function(container, theme) { } } - var width = dom.getInnerWidth(this.container); - if (force || size.width != width) { + if (!width) + width = dom.getInnerWidth(this.container); + if (force || this.resizing > 1 || size.width != width) { size.width = width; var gutterWidth = this.showGutter ? this.$gutter.offsetWidth : 0; this.scroller.style.left = gutterWidth + "px"; size.scrollerWidth = Math.max(0, width - gutterWidth - this.scrollBar.getWidth()); - this.scroller.style.width = size.scrollerWidth + "px"; + //this.scroller.style.width = size.scrollerWidth + "px"; if (this.session.getUseWrapMode() && this.adjustWrapLimit() || force) changes = changes | this.CHANGE_FULL; } - this.$loop.schedule(changes); + if (force) + this.$renderChanges(changes, true); + else + this.$loop.schedule(changes); + + if (force) + delete this.resizing; }; /** @@ -642,8 +662,8 @@ var VirtualRenderer = function(container, theme) { this.scrollBar.setScrollTop(this.scrollTop); }; - this.$renderChanges = function(changes) { - if (!changes || !this.session || !this.container.offsetWidth) + this.$renderChanges = function(changes, force) { + if (!force && (!changes || !this.session || !this.container.offsetWidth)) return; // text, scrolling and resize changes can cause the view port size to change