diff --git a/lib/ace/edit_session.js b/lib/ace/edit_session.js index 60b0d4a2..23c568ee 100644 --- a/lib/ace/edit_session.js +++ b/lib/ace/edit_session.js @@ -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: * diff --git a/lib/ace/ext/show_settings_menu.js b/lib/ace/ext/show_settings_menu.js index 311c70c1..3dc1a789 100644 --- a/lib/ace/ext/show_settings_menu.js +++ b/lib/ace/ext/show_settings_menu.js @@ -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.