* Gets the height of the editor * @param {object} editor * @returns
(editor)
| 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 | |
| 3068 | export default EditorManager; |
nothing calls this directly
no outgoing calls
no test coverage detected