MCPcopy Create free account
hub / github.com/Acode-Foundation/Acode / flushDecorations

Method flushDecorations

src/cm/colorView.ts:378–391  ·  view source on GitHub ↗
(view: EditorView, dirtyRanges: readonly DocRange[])

Source from the content-addressed store, hash-verified

376 }
377
378 flushDecorations(view: EditorView, dirtyRanges: readonly DocRange[]): void {
379 const visibleRanges = normalizeRanges(view.visibleRanges);
380 const dirtyVisibleRanges = intersectRanges(dirtyRanges, visibleRanges);
381 const add = colorRanges(view, dirtyVisibleRanges);
382
383 this.decorations = this.decorations.update({
384 filter: (from, to) =>
385 intersectsRanges(from, to, visibleRanges) &&
386 !intersectsRanges(from, to, dirtyVisibleRanges),
387 add,
388 sort: true,
389 });
390 this.visibleRanges = visibleRanges;
391 }
392
393 changePicker(view: EditorView, canBeEdited: boolean): void {
394 const doms = view.contentDOM.querySelectorAll("input[type=color]");

Callers 1

scheduleFlushMethod · 0.95

Calls 5

normalizeRangesFunction · 0.85
intersectRangesFunction · 0.85
colorRangesFunction · 0.85
intersectsRangesFunction · 0.85
updateMethod · 0.45

Tested by

no test coverage detected