adds setWrapLimit to session

This commit is contained in:
Matthew Kastor 2013-04-01 15:57:30 -04:00 committed by nightwing
commit b0c08dced1
2 changed files with 12 additions and 7 deletions

View file

@ -1612,7 +1612,18 @@ var EditSession = function(text, mode) {
this.getWrapLimit = function() {
return this.$wrapLimit;
};
/**
* Sets the line length for soft wrap in the editor. Lines will break
* at a minimum of the given length minus 20 chars and at a maximum
* of the given number of chars.
* @param {number} limit The maximum line length in chars, for soft
* wrapping lines.
*/
this.setWrapLimit = function (limit) {
this.setWrapLimitRange(limit - 20, limit);
};
/**
* Returns an object that defines the minimum and maximum of the wrap limit; it looks something like this:
*

View file

@ -69,12 +69,6 @@ define(function(require, exports, module) {
function addFunctionsForSettingsMenu (editor) {
// when building the settings menu matching get and set functions
// must be found or the function will be ignored
// this allows the settings menu to supply a wrap limit
// using a text input field easily
editor.session.setWrapLimit = function (limit) {
editor.session.setWrapLimitRange(limit - 20, limit);
};
}
/**
* Generates a list of set functions for the settings menu.