From 0c99e5990dcfa6befe694d108411767f15100d51 Mon Sep 17 00:00:00 2001 From: lushnikov Date: Wed, 13 Jul 2016 07:41:40 -0700 Subject: [PATCH] DevTools: [LiveSASS] property enabling/disabling should not add spaces BUG=none R=pfeldman Review-Url: https://codereview.chromium.org/2020803002 Cr-Commit-Position: refs/heads/master@{#405147} --- front_end/sass/SASSSupport.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/front_end/sass/SASSSupport.js b/front_end/sass/SASSSupport.js index 0a81a04251..8c5b285a21 100644 --- a/front_end/sass/SASSSupport.js +++ b/front_end/sass/SASSSupport.js @@ -250,7 +250,10 @@ WebInspector.SASSSupport.Property.prototype = { } var oldRange1 = new WebInspector.TextRange(this.range.startLine, this.range.startColumn, this.range.startLine, this.name.range.startColumn); var edit1 = new WebInspector.SourceEdit(this.document.url, oldRange1, ""); - var oldRange2 = new WebInspector.TextRange(this.range.endLine, this.range.endColumn - 2, this.range.endLine, this.range.endColumn); + + var propertyText = this.document.text.extract(this.range); + var endsWithSemicolon = propertyText.slice(0, -2).trim().endsWith(";"); + var oldRange2 = new WebInspector.TextRange(this.range.endLine, this.value.range.endColumn + (endsWithSemicolon ? 1 : 0), this.range.endLine, this.range.endColumn); var edit2 = new WebInspector.SourceEdit(this.document.url, oldRange2, ""); this.document.edits.push(edit1, edit2); },