avoid emitting spurious changeWrapMode event

This commit is contained in:
nightwing 2015-01-19 01:15:24 +04:00
commit 7db217dfe0

View file

@ -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()) {