From 362315c638d2e6f682098635028c7aecdd9319f3 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sun, 28 Dec 2014 12:34:42 +0100 Subject: [PATCH] AttribManager#removeAttribOnLine: Remove Linemarker entirely if there's nothing else left --- src/static/js/AttributeManager.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/static/js/AttributeManager.js b/src/static/js/AttributeManager.js index b1f6b421..1da1056a 100644 --- a/src/static/js/AttributeManager.js +++ b/src/static/js/AttributeManager.js @@ -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);