add missing options

This commit is contained in:
nightwing 2013-03-14 16:54:07 +04:00
commit b61ae38c14
4 changed files with 25 additions and 13 deletions

View file

@ -491,10 +491,7 @@ var EditSession = function(text, mode) {
* *
**/ **/
this.setOverwrite = function(overwrite) { this.setOverwrite = function(overwrite) {
if (this.$overwrite == overwrite) return; this.setOption("overwrite", overwrite)
this.$overwrite = overwrite;
this._emit("changeOverwrite");
}; };
/** /**
@ -2437,6 +2434,15 @@ config.defineOptions(EditSession.prototype, "session", {
}, },
initialValue: 4, initialValue: 4,
handlesSet: true 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
} }
}); });

View file

@ -2219,6 +2219,7 @@ config.defineOptions(Editor.prototype, "editor", {
behavioursEnabled: {initialValue: true}, behavioursEnabled: {initialValue: true},
wrapBehavioursEnabled: {initialValue: true}, wrapBehavioursEnabled: {initialValue: true},
hScrollBarAlwaysVisible: "renderer",
highlightGutterLine: "renderer", highlightGutterLine: "renderer",
animatedScroll: "renderer", animatedScroll: "renderer",
showInvisibles: "renderer", showInvisibles: "renderer",
@ -2234,6 +2235,8 @@ config.defineOptions(Editor.prototype, "editor", {
focusTimout: "$mouseHandler", focusTimout: "$mouseHandler",
firstLineNumber: "session", firstLineNumber: "session",
overwrite: "session",
newLineMode: "session",
useWorker: "session", useWorker: "session",
useSoftTabs: "session", useSoftTabs: "session",
tabSize: "session", tabSize: "session",

View file

@ -137,7 +137,7 @@ var MouseHandler = function(editor) {
}).call(MouseHandler.prototype); }).call(MouseHandler.prototype);
config.defineOptions(MouseHandler.prototype, "mouseHandler", { config.defineOptions(MouseHandler.prototype, "mouseHandler", {
scrollSpeed: {initialValue: 1}, scrollSpeed: {initialValue: 2},
dragDelay: {initialValue: 150}, dragDelay: {initialValue: 150},
focusTimout: {initialValue: 0} focusTimout: {initialValue: 0}
}); });

View file

@ -102,7 +102,6 @@ var VirtualRenderer = function(container, theme) {
// Indicates whether the horizontal scrollbar is visible // Indicates whether the horizontal scrollbar is visible
this.$horizScroll = false; this.$horizScroll = false;
this.$horizScrollAlwaysVisible = false;
this.scrollBar = new ScrollBar(this.container); this.scrollBar = new ScrollBar(this.container);
this.scrollBar.addEventListener("scroll", function(e) { this.scrollBar.addEventListener("scroll", function(e) {
@ -615,7 +614,7 @@ var VirtualRenderer = function(container, theme) {
* @returns {Boolean} * @returns {Boolean}
**/ **/
this.getHScrollBarAlwaysVisible = function() { this.getHScrollBarAlwaysVisible = function() {
return this.$horizScrollAlwaysVisible; return this.$hScrollBarAlwaysVisible;
}; };
/** /**
@ -625,11 +624,7 @@ var VirtualRenderer = function(container, theme) {
* *
**/ **/
this.setHScrollBarAlwaysVisible = function(alwaysVisible) { this.setHScrollBarAlwaysVisible = function(alwaysVisible) {
if (this.$horizScrollAlwaysVisible != alwaysVisible) { this.setOption("hScrollBarAlwaysVisible", alwaysVisible);
this.$horizScrollAlwaysVisible = alwaysVisible;
if (!this.$horizScrollAlwaysVisible || !this.$horizScroll)
this.$loop.schedule(this.CHANGE_SCROLL);
}
}; };
this.$updateScrollBar = function() { this.$updateScrollBar = function() {
@ -744,7 +739,7 @@ var VirtualRenderer = function(container, theme) {
var longestLine = this.$getLongestLine(); 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; var horizScrollChanged = this.$horizScroll !== horizScroll;
this.$horizScroll = horizScroll; this.$horizScroll = horizScroll;
if (horizScrollChanged) { if (horizScrollChanged) {
@ -1398,6 +1393,14 @@ config.defineOptions(VirtualRenderer.prototype, "renderer", {
}, },
initialValue: false, initialValue: false,
value: true value: true
},
hScrollBarAlwaysVisible: {
set: function(alwaysVisible) {
this.$hScrollBarAlwaysVisible = alwaysVisible;
if (!this.$hScrollBarAlwaysVisible || !this.$horizScroll)
this.$loop.schedule(this.CHANGE_SCROLL);
},
initialValue: false
} }
}); });