From b61ae38c14919e601426b130d308ed449d57f9a7 Mon Sep 17 00:00:00 2001 From: nightwing Date: Thu, 14 Mar 2013 16:54:07 +0400 Subject: [PATCH] add missing options --- lib/ace/edit_session.js | 14 ++++++++++---- lib/ace/editor.js | 3 +++ lib/ace/mouse/mouse_handler.js | 2 +- lib/ace/virtual_renderer.js | 19 +++++++++++-------- 4 files changed, 25 insertions(+), 13 deletions(-) diff --git a/lib/ace/edit_session.js b/lib/ace/edit_session.js index 0d4efec8..d2d02a62 100644 --- a/lib/ace/edit_session.js +++ b/lib/ace/edit_session.js @@ -491,10 +491,7 @@ var EditSession = function(text, mode) { * **/ this.setOverwrite = function(overwrite) { - if (this.$overwrite == overwrite) return; - - this.$overwrite = overwrite; - this._emit("changeOverwrite"); + this.setOption("overwrite", overwrite) }; /** @@ -2437,6 +2434,15 @@ config.defineOptions(EditSession.prototype, "session", { }, initialValue: 4, handlesSet: true + }, + overwrite: { + set: function(val) {this._emit("changeOverwrite");}, + initialValue: false + }, + newLineMode: { + set: function(val) {this.doc.setNewLineMode(val)}, + get: function() {return this.doc.getNewLineMode(newLineMode)}, + handlesSet: true } }); diff --git a/lib/ace/editor.js b/lib/ace/editor.js index 5a7e4022..3810363a 100644 --- a/lib/ace/editor.js +++ b/lib/ace/editor.js @@ -2219,6 +2219,7 @@ config.defineOptions(Editor.prototype, "editor", { behavioursEnabled: {initialValue: true}, wrapBehavioursEnabled: {initialValue: true}, + hScrollBarAlwaysVisible: "renderer", highlightGutterLine: "renderer", animatedScroll: "renderer", showInvisibles: "renderer", @@ -2234,6 +2235,8 @@ config.defineOptions(Editor.prototype, "editor", { focusTimout: "$mouseHandler", firstLineNumber: "session", + overwrite: "session", + newLineMode: "session", useWorker: "session", useSoftTabs: "session", tabSize: "session", diff --git a/lib/ace/mouse/mouse_handler.js b/lib/ace/mouse/mouse_handler.js index f8804519..74fc4872 100644 --- a/lib/ace/mouse/mouse_handler.js +++ b/lib/ace/mouse/mouse_handler.js @@ -137,7 +137,7 @@ var MouseHandler = function(editor) { }).call(MouseHandler.prototype); config.defineOptions(MouseHandler.prototype, "mouseHandler", { - scrollSpeed: {initialValue: 1}, + scrollSpeed: {initialValue: 2}, dragDelay: {initialValue: 150}, focusTimout: {initialValue: 0} }); diff --git a/lib/ace/virtual_renderer.js b/lib/ace/virtual_renderer.js index 0de955cb..8bc071d2 100644 --- a/lib/ace/virtual_renderer.js +++ b/lib/ace/virtual_renderer.js @@ -102,7 +102,6 @@ var VirtualRenderer = function(container, theme) { // Indicates whether the horizontal scrollbar is visible this.$horizScroll = false; - this.$horizScrollAlwaysVisible = false; this.scrollBar = new ScrollBar(this.container); this.scrollBar.addEventListener("scroll", function(e) { @@ -615,7 +614,7 @@ var VirtualRenderer = function(container, theme) { * @returns {Boolean} **/ this.getHScrollBarAlwaysVisible = function() { - return this.$horizScrollAlwaysVisible; + return this.$hScrollBarAlwaysVisible; }; /** @@ -625,11 +624,7 @@ var VirtualRenderer = function(container, theme) { * **/ this.setHScrollBarAlwaysVisible = function(alwaysVisible) { - if (this.$horizScrollAlwaysVisible != alwaysVisible) { - this.$horizScrollAlwaysVisible = alwaysVisible; - if (!this.$horizScrollAlwaysVisible || !this.$horizScroll) - this.$loop.schedule(this.CHANGE_SCROLL); - } + this.setOption("hScrollBarAlwaysVisible", alwaysVisible); }; this.$updateScrollBar = function() { @@ -744,7 +739,7 @@ var VirtualRenderer = function(container, theme) { var longestLine = this.$getLongestLine(); - var horizScroll = this.$horizScrollAlwaysVisible || this.$size.scrollerWidth - longestLine < 0; + var horizScroll = this.$hScrollBarAlwaysVisible || this.$size.scrollerWidth - longestLine < 0; var horizScrollChanged = this.$horizScroll !== horizScroll; this.$horizScroll = horizScroll; if (horizScrollChanged) { @@ -1398,6 +1393,14 @@ config.defineOptions(VirtualRenderer.prototype, "renderer", { }, initialValue: false, value: true + }, + hScrollBarAlwaysVisible: { + set: function(alwaysVisible) { + this.$hScrollBarAlwaysVisible = alwaysVisible; + if (!this.$hScrollBarAlwaysVisible || !this.$horizScroll) + this.$loop.schedule(this.CHANGE_SCROLL); + }, + initialValue: false } });