diff --git a/lib/ace/edit_session.js b/lib/ace/edit_session.js index b11ff05c..b35ea4e0 100644 --- a/lib/ace/edit_session.js +++ b/lib/ace/edit_session.js @@ -1580,13 +1580,11 @@ var EditSession = function(text, mode) { **/ this.setWrapLimitRange = function(min, max) { if (this.$wrapLimitRange.min !== min || this.$wrapLimitRange.max !== max) { - this.$wrapLimitRange = { - min: min, - max: max - }; + this.$wrapLimitRange = { min: min, max: max }; this.$modified = true; // This will force a recalculation of the wrap limit - this._signal("changeWrapMode"); + if (this.$useWrapMode) + this._signal("changeWrapMode"); } }; @@ -2467,6 +2465,7 @@ config.defineOptions(EditSession.prototype, "session", { if (this.$wrap == value) return; + this.$wrap = value; if (!value) { this.setUseWrapMode(false); } else { @@ -2474,7 +2473,6 @@ config.defineOptions(EditSession.prototype, "session", { this.setWrapLimitRange(col, col); this.setUseWrapMode(true); } - this.$wrap = value; }, get: function() { if (this.getUseWrapMode()) {