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

Class

src/cm/scrollPastEnd.ts:14–32  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12
13 const plugin = ViewPlugin.fromClass(
14 class {
15 height = 0;
16 attrs = { style: "" };
17
18 update(update: ViewUpdate) {
19 const { view } = update;
20 const anyView = view as any;
21 const maxScrollHeight =
22 (anyView.viewState?.editorHeight ?? 0) -
23 view.defaultLineHeight -
24 (anyView.documentPadding?.top ?? 0) -
25 0.5;
26 const height = Math.max(0, Math.round(maxScrollHeight * factor));
27 if (height !== this.height) {
28 this.height = height;
29 this.attrs = { style: `padding-bottom: ${height}px` };
30 }
31 }
32 },
33 );
34
35 return [

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected