fixup! delay colorview for invisible CMs
This commit is contained in:
parent
3905722cdf
commit
d0bb996e1e
|
@ -73,6 +73,11 @@
|
||||||
const height = cm.display.lastWrapHeight;
|
const height = cm.display.lastWrapHeight;
|
||||||
if (!height || !textHeight) return;
|
if (!height || !textHeight) return;
|
||||||
maxRenderChunkSize = Math.max(20, Math.ceil(height / textHeight));
|
maxRenderChunkSize = Math.max(20, Math.ceil(height / textHeight));
|
||||||
|
const state = cm.state.colorpicker;
|
||||||
|
if (state.colorizeOnUpdate) {
|
||||||
|
state.colorizeOnUpdate = false;
|
||||||
|
colorizeAll(state);
|
||||||
|
}
|
||||||
cm.off('update', CM_EVENTS.update);
|
cm.off('update', CM_EVENTS.update);
|
||||||
},
|
},
|
||||||
mousedown(cm, event) {
|
mousedown(cm, event) {
|
||||||
|
@ -166,7 +171,7 @@
|
||||||
const {cm} = state;
|
const {cm} = state;
|
||||||
const {viewFrom, viewTo} = cm.display;
|
const {viewFrom, viewTo} = cm.display;
|
||||||
if (!viewTo) {
|
if (!viewTo) {
|
||||||
requestAnimationFrame(() => colorizeAll(state));
|
state.colorizeOnUpdate = true;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const {curOp} = cm;
|
const {curOp} = cm;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user