diff --git a/demo/requirejs+build.html b/demo/requirejs+build.html new file mode 100644 index 00000000..4a494063 --- /dev/null +++ b/demo/requirejs+build.html @@ -0,0 +1,43 @@ + + + + + + Editor + + + + +
function foo(items) {
+    var i;
+    for (i = 0; i < items.length; i++) {
+        alert("Ace Rocks " + items[i]);
+    }
+}
+ + + + + + + diff --git a/demo/scrollable-page.html b/demo/scrollable-page.html new file mode 100644 index 00000000..308208ed --- /dev/null +++ b/demo/scrollable-page.html @@ -0,0 +1,150 @@ + + + + + + Editor + + + +
+ + scroll down ⇓ + +
+
function foo(items) {
+    var i;
+    for (i = 0; i < items.length; i++) {
+        alert("Ace Rocks " + items[i]);
+    }
+
+}
+
+
+ press F11 to switch to fullscreen mode +
+ + + + + +
+ + + + + + diff --git a/lib/ace/css/editor.css b/lib/ace/css/editor.css index ac64e002..841c78a4 100644 --- a/lib/ace/css/editor.css +++ b/lib/ace/css/editor.css @@ -131,7 +131,6 @@ .ace_gutter .ace_layer { position: relative; - min-width: 40px; width: auto; text-align: right; pointer-events: auto; diff --git a/lib/ace/layer/gutter.js b/lib/ace/layer/gutter.js index 1c6607cb..2a9438b4 100644 --- a/lib/ace/layer/gutter.js +++ b/lib/ace/layer/gutter.js @@ -148,17 +148,15 @@ var Gutter = function(parentEl) { i++; } - if (this.session.$useWrapMode) - html.push( - "
", - this.session.getLength() - 1, - "
" - ); - this.element = dom.setInnerHtml(this.element, html.join("")); this.element.style.height = config.minHeight + "px"; - var gutterWidth = this.element.offsetWidth; + if (this.session.$useWrapMode) + i = this.session.getLength(); + + var gutterWidth = ("" + --i).length * config.characterWidth; + var padding = this.$padding || this.$computePadding(); + gutterWidth += padding.left + padding.right; if (gutterWidth !== this.gutterWidth) { this.gutterWidth = gutterWidth; this._emit("changeGutterWidth", gutterWidth); diff --git a/lib/ace/virtual_renderer.js b/lib/ace/virtual_renderer.js index 252fed11..69a04240 100644 --- a/lib/ace/virtual_renderer.js +++ b/lib/ace/virtual_renderer.js @@ -735,12 +735,10 @@ var VirtualRenderer = function(container, theme) { this.$gutterLayer.update(this.layerConfig); } else if (changes & this.CHANGE_LINES) { - if (this.$updateLines()) { - this.$updateScrollBar(); - if (this.showGutter) - this.$gutterLayer.update(this.layerConfig); - } - } else if (changes & this.CHANGE_GUTTER) { + if (this.$updateLines() || (changes & this.CHANGE_GUTTER) && this.showGutter) + this.$gutterLayer.update(this.layerConfig); + } + else if (changes & this.CHANGE_TEXT || changes & this.CHANGE_GUTTER) { if (this.showGutter) this.$gutterLayer.update(this.layerConfig); } diff --git a/tool/perf-test.html b/tool/perf-test.html new file mode 100644 index 00000000..74603400 --- /dev/null +++ b/tool/perf-test.html @@ -0,0 +1,357 @@ + + + + + + + Ace Profile util + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + +
+ + + + +
+ +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+
+ +
+ + + + + + + + +