diff --git a/vendor-overwrites/colorpicker/colorview.js b/vendor-overwrites/colorpicker/colorview.js index e96890a0..6aea3c2f 100644 --- a/vendor-overwrites/colorpicker/colorview.js +++ b/vendor-overwrites/colorpicker/colorview.js @@ -555,8 +555,9 @@ } const {cm, line, ch, embedderCallback} = this; const to = {line, ch: ch + this.prevColor.length}; - if (cm.getRange(this, to) !== newColor) { - cm.replaceRange(newColor, this, to, '*colorpicker'); + const from = {line, ch}; + if (cm.getRange(from, to) !== newColor) { + cm.replaceRange(newColor, from, to, '*colorpicker'); this.prevColor = newColor; } if (typeof embedderCallback === 'function') {