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

Function getEditorHeight

src/lib/editorManager.js:3031–3042  ·  view source on GitHub ↗

* Gets the height of the editor * @param {object} editor * @returns

(editor)

Source from the content-addressed store, hash-verified

3029 * @returns
3030 */
3031 function getEditorHeight(editor) {
3032 try {
3033 const view = editor;
3034 if (!view || !view.scrollDOM) return 0;
3035
3036 const total = view.scrollDOM.scrollHeight || 0;
3037 const viewport = view.scrollDOM.clientHeight || 0;
3038 return Math.max(total - viewport, 0);
3039 } catch (_) {
3040 return 0;
3041 }
3042 }
3043
3044 /**
3045 * Gets the height of the editor

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected