do not add set/get option methods automatically

This commit is contained in:
nightwing 2013-02-13 15:59:15 +04:00
commit d469335936
4 changed files with 377 additions and 189 deletions

View file

@ -456,6 +456,27 @@ var EditSession = function(text, mode) {
}
};
/**
/**
* Pass `true` to enable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character (`'\t'`).
* @param {Boolean} useSoftTabs Value indicating whether or not to use soft tabs
**/
this.setUseSoftTabs = function(val) { this.setOption("useSoftTabs", val); };
/**
* Returns `true` if soft tabs are being used, `false` otherwise.
* @returns {Boolean}
**/
this.getUseSoftTabs = function() { return this.$useSoftTabs; };
/**
* Set the number of spaces that define a soft tab; for example, passing in `4` transforms the soft tabs to be equivalent to four spaces. This function also emits the `changeTabSize` event.
* @param {Number} tabSize The new tab size
**/
this.setTabSize = function(tabSize) { this.setOption("tabSize", tabsSize) }
/**
* Returns the current tab size.
**/
this.getTabSize = function() { return this.$tabSize; };
/**
* Returns `true` if the character at the position is a soft tab.
* @param {Object} position The position to check
@ -823,6 +844,18 @@ var EditSession = function(text, mode) {
return this.doc.getNewLineMode();
};
/**
* Identifies if you want to use a worker for the `EditSession`.
* @param {Boolean} useWorker Set to `true` to use a worker
*
**/
this.setUseWorker = function(useWorker) { this.setOption("useWorker", useWorker); };
/**
* Returns `true` if workers are being used.
**/
this.getUseWorker = function() { return this.$useWorker; };
/**
* Reloads all the tokens on the current session. This function calls [[BackgroundTokenizer.start `BackgroundTokenizer.start ()`]] to all the rows; it also emits the `'tokenizerUpdate'` event.
**/
@ -2337,26 +2370,7 @@ var EditSession = function(text, mode) {
require("./edit_session/folding").Folding.call(EditSession.prototype);
require("./edit_session/bracket_match").BracketMatch.call(EditSession.prototype);
/**
* Pass `true` to enable the use of soft tabs. Soft tabs means you're using spaces instead of the tab character (`'\t'`).
* @param {Boolean} useSoftTabs Value indicating whether or not to use soft tabs
* @method EditSession.setUseSoftTabs
**/
/**
* Set the number of spaces that define a soft tab; for example, passing in `4` transforms the soft tabs to be equivalent to four spaces. This function also emits the `changeTabSize` event.
* @param {Number} tabSize The new tab size
* @method EditSession.setTabSize
**/
/**
* Identifies if you want to use a worker for the `EditSession`.
* @param {Boolean} useWorker Set to `true` to use a worker
* @method EditSession.setUseWorker
**/
/**
* Sets the number displayed in the gutter for the first line of code.
* @param {Number} firstLineNumber The number displayed in the gutter for the first line of code.
* @method EditSession.setFirstLineNumber
*/
config.defineOptions(EditSession.prototype, "session", {
wrap: {
set: function(value) {