update wrapData when wrapMethod changes
This commit is contained in:
parent
188252891a
commit
60cfe6f161
1 changed files with 12 additions and 5 deletions
|
|
@ -948,9 +948,9 @@ var EditSession = function(text, mode) {
|
|||
this.tokenRe = mode.tokenRe;
|
||||
this.nonTokenRe = mode.nonTokenRe;
|
||||
|
||||
this.$options.wrapMethod.set.call(this, this.$wrapMethod);
|
||||
|
||||
if (!$isPlaceholder) {
|
||||
this.$options.wrapMethod.set.call(this, this.$wrapMethod);
|
||||
this.$setFolding(mode.foldingRules);
|
||||
this._emit("changeMode");
|
||||
this.bgTokenizer.start(0);
|
||||
|
|
@ -2456,10 +2456,17 @@ config.defineOptions(EditSession.prototype, "session", {
|
|||
wrapMethod: {
|
||||
// code|text|auto
|
||||
set: function(val) {
|
||||
if (val == "auto")
|
||||
this.$wrapAsCode = this.$mode.type != "text";
|
||||
else
|
||||
this.$wrapAsCode = val != "text";
|
||||
val = val == "auto"
|
||||
? this.$mode.type != "text"
|
||||
: val != "text";
|
||||
if (val != this.$wrapAsCode) {
|
||||
this.$wrapAsCode = val;
|
||||
if (this.$useWrapMode) {
|
||||
this.$modified = true;
|
||||
this.$resetRowCache(0);
|
||||
this.$updateWrapData(0, this.getLength() - 1);
|
||||
}
|
||||
}
|
||||
},
|
||||
initialValue: "auto"
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue