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

Function getEditorWidth

src/lib/editorManager.js:3049–3065  ·  view source on GitHub ↗

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

(editor)

Source from the content-addressed store, hash-verified

3047 * @returns
3048 */
3049 function getEditorWidth(editor) {
3050 try {
3051 const view = editor;
3052 if (!view || !view.scrollDOM) return 0;
3053
3054 const total = view.scrollDOM.scrollWidth || 0;
3055 const viewport = view.scrollDOM.clientWidth || 0;
3056 let width = Math.max(total - viewport, 0);
3057 if (!appSettings.value.textWrap) {
3058 const { leftMargin = 0 } = appSettings.value;
3059 width += leftMargin || 0;
3060 }
3061 return width;
3062 } catch (_) {
3063 return 0;
3064 }
3065 }
3066}
3067
3068export default EditorManager;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected