own list
This commit is contained in:
parent
382804e44c
commit
ed3ec96838
|
@ -175,13 +175,17 @@ AttributeManager.prototype = _(AttributeManager.prototype).extend({
|
||||||
if (!found) {
|
if (!found) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ChangesetUtils.buildKeepToStartOfRange(this.rep, builder, [lineNum, 0]);
|
ChangesetUtils.buildKeepToStartOfRange(this.rep, builder, [lineNum, 0]);
|
||||||
var list = _.chain(attribs).filter(function(a){return !!a[1];}).map(function(a){return a[0];}).value();
|
|
||||||
|
var countAttribsWithMarker = _.chain(attribs).filter(function(a){return !!a[1];})
|
||||||
|
.map(function(a){return a[0];}).difference(['author', 'lmkr', 'insertorder', 'start']).size().value();
|
||||||
|
|
||||||
//if we have marker and any of attributes don't need to have marker. we need delete it
|
//if we have marker and any of attributes don't need to have marker. we need delete it
|
||||||
if(hasMarker && !_.intersection(lineAttributes,list)){
|
if(hasMarker && !countAttribsWithMarker){
|
||||||
ChangesetUtils.buildRemoveRange(this.rep, builder, [lineNum, 1], [lineNum, 2]);
|
ChangesetUtils.buildRemoveRange(this.rep, builder, [lineNum, 0], [lineNum, 1]);
|
||||||
}else{
|
}else{
|
||||||
ChangesetUtils.buildKeepRange(this.rep, builder, [lineNum, 1], [lineNum, 2], attribs, this.rep.apool);
|
ChangesetUtils.buildKeepRange(this.rep, builder, [lineNum, 0], [lineNum, 1], attribs, this.rep.apool);
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.applyChangeset(builder);
|
return this.applyChangeset(builder);
|
||||||
|
|
Loading…
Reference in New Issue