From e18c9cad9f71f9c5d09f76a3347b680f981a88f8 Mon Sep 17 00:00:00 2001 From: Fabian Jakobs Date: Sat, 26 Feb 2011 20:44:48 +0100 Subject: [PATCH 1/2] if possible append the measure node to the body to prevent flickering --- lib/ace/layer/text.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/lib/ace/layer/text.js b/lib/ace/layer/text.js index 953d4411..84d2d2ec 100644 --- a/lib/ace/layer/text.js +++ b/lib/ace/layer/text.js @@ -113,11 +113,15 @@ var Text = function(parentEl) { // Note: characterWidth can be a float! measureNode.innerHTML = lang.stringRepeat("Xy", n); - var container = this.element.parentNode; - while (!dom.hasCssClass(container, "ace_editor")) - container = container.parentNode; + if (document.body) { + document.body.appendChild(measureNode); + } else { + var container = this.element.parentNode; + while (!dom.hasCssClass(container, "ace_editor")) + container = container.parentNode; + container.appendChild(measureNode); + } - container.appendChild(measureNode); } var style = this.$measureNode.style; From 17bce83df527af24ebac2075ddb554b11e9c0d97 Mon Sep 17 00:00:00 2001 From: Ruben Daniels Date: Sat, 26 Feb 2011 18:05:56 -0800 Subject: [PATCH 2/2] Added missing settings functions --- lib/ace/virtual_renderer.js | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/ace/virtual_renderer.js b/lib/ace/virtual_renderer.js index 8d3f745c..0027d18c 100644 --- a/lib/ace/virtual_renderer.js +++ b/lib/ace/virtual_renderer.js @@ -277,6 +277,10 @@ var VirtualRenderer = function(container, theme) { this.getPrintMarginColumn = function() { return this.$printMarginColumn; }; + + this.getShowGutter = function(){ + return this.showGutter; + } this.setShowGutter = function(show){ if(this.showGutter === show) @@ -365,6 +369,10 @@ var VirtualRenderer = function(container, theme) { this.$updatePrintMargin(); }; + this.getHScrollBarAlwaysVisible = function() { + return this.$horizScrollAlwaysVisible; + } + this.setHScrollBarAlwaysVisible = function(alwaysVisible) { if (this.$horizScrollAlwaysVisible != alwaysVisible) { this.$horizScrollAlwaysVisible = alwaysVisible;