| 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 [ |
nothing calls this directly
no outgoing calls
no test coverage detected