fix subsequent clicks in colorpicker
seems like new CodeMirror modifies the position object
This commit is contained in:
parent
6d04c0eb7d
commit
463c3b5139
|
@ -555,8 +555,9 @@
|
||||||
}
|
}
|
||||||
const {cm, line, ch, embedderCallback} = this;
|
const {cm, line, ch, embedderCallback} = this;
|
||||||
const to = {line, ch: ch + this.prevColor.length};
|
const to = {line, ch: ch + this.prevColor.length};
|
||||||
if (cm.getRange(this, to) !== newColor) {
|
const from = {line, ch};
|
||||||
cm.replaceRange(newColor, this, to, '*colorpicker');
|
if (cm.getRange(from, to) !== newColor) {
|
||||||
|
cm.replaceRange(newColor, from, to, '*colorpicker');
|
||||||
this.prevColor = newColor;
|
this.prevColor = newColor;
|
||||||
}
|
}
|
||||||
if (typeof embedderCallback === 'function') {
|
if (typeof embedderCallback === 'function') {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user