AttribManager#removeAttribOnLine: Remove Linemarker entirely if there's nothing else left

pull/2409/head
Marcel Klehr 2014-12-28 12:34:42 +01:00
parent 036df30c0e
commit 362315c638
1 changed files with 3 additions and 1 deletions

View File

@ -172,7 +172,9 @@ AttributeManager.prototype = _(AttributeManager.prototype).extend({
if(hasMarker){
ChangesetUtils.buildKeepRange(this.rep, builder, loc, (loc = [lineNum, 0]));
ChangesetUtils.buildKeepRange(this.rep, builder, loc, (loc = [lineNum, 1]), attribs, this.rep.apool);
// If length == 4, there's [author, lmkr, insertorder, + the attrib being removed] thus we can remove the marker entirely
if(attribs.length == 4) ChangesetUtils.buildRemoveRange(this.rep, builder, loc, (loc = [lineNum, 1]))
else ChangesetUtils.buildKeepRange(this.rep, builder, loc, (loc = [lineNum, 1]), attribs, this.rep.apool);
}
return this.applyChangeset(builder);