Measure the editor chrome instead of assuming 38px, so the last lines are reachable

This commit is contained in:
Gmer4Lfe
2026-08-04 21:16:15 -04:00
parent a13c5541cc
commit 1761087283
+11 -1
View File
@@ -1171,7 +1171,17 @@ function vvFitRight() {
}
const ed = document.getElementById('vv-editor');
if (ed.style.display !== 'none') {
const _edH = Math.max(60, contentH - 38) + 'px';
// Everything inside the editor pane that is not the text box: the status bar below it, and
// the shortcut help above when open. Measured, not assumed — this subtracted a hardcoded
// 38px, which under-counted the real chrome by ~100px. The textarea was therefore sized
// taller than #vv-editor-wrap, which is overflow:hidden, so its last ~6 lines rendered
// below the clip with the textarea's own scroll already at its end: nothing to scroll, and
// content you can see is missing. Reported against master.conf as stopping mid-line 1684
// of 1689, unchanged by expanding or collapsing the job tree — a fixed offset, which is
// what a constant this wrong looks like.
const _wrap = document.getElementById('vv-editor-wrap');
const _chrome = Math.max(0, ed.scrollHeight - _wrap.offsetHeight);
const _edH = Math.max(60, contentH - _chrome) + 'px';
const _ta = document.getElementById('vv-editor-body');
_ta.style.height = _edH;
document.getElementById('vv-ln-gutter').style.height = _edH;