Merge pull request #2409 from ether/fix-removeAttribOnLine

AttribManager#removeAttribOnLine: Remove Linemarker entirely if there's nothing else left
pull/2411/head^2
John McLear 2014-12-28 12:52:39 +01:00
commit 68f50ff9fa
1 changed files with 3 additions and 1 deletions

View File

@ -172,7 +172,9 @@ AttributeManager.prototype = _(AttributeManager.prototype).extend({
if(hasMarker){ if(hasMarker){
ChangesetUtils.buildKeepRange(this.rep, builder, loc, (loc = [lineNum, 0])); 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); return this.applyChangeset(builder);