Fix editor click alignment in Firefox and enable arr cleanup scripts in daily maintenance

This commit is contained in:
Gmer4Lfe
2026-06-26 22:35:47 -04:00
parent 97dfd522d0
commit ccaf19cfe4
3 changed files with 12 additions and 6 deletions
+2 -1
View File
@@ -339,7 +339,8 @@ body.vv-fullscreen #displaybox { padding-left: 1rem !important; padding-top: .5r
.vv-editor-body { font-family: monospace; font-size: 12px; background: #0d0d0d; color: #ccc;
border: 1px solid #333; border-radius: 4px; padding: 10px 12px; resize: none;
line-height: 1.5; scroll-behavior: auto; tab-size: 2; width: 100%; box-sizing: border-box;
white-space: pre; overflow-x: auto; }
white-space: pre; overflow-x: auto;
appearance: none; -moz-appearance: none; }
/* Editor layout: gutter + inner area — unified bordered block */
#vv-editor-wrap { display: flex; border: 1px solid #2e2e2e; border-radius: 4px 4px 0 0;
+8 -3
View File
@@ -1034,7 +1034,11 @@ const VV_CLOSE = new Set([')', ']', '}', '"', "'", '`']);
let vvFontSizePx = parseInt(localStorage.getItem('vv-editor-fontsize') || '12') || 12;
let vvWordWrap = localStorage.getItem('vv-editor-wordwrap') === '1';
// Line height helper — used everywhere instead of hardcoded 18
function vvLH() { return vvFontSizePx * 1.5; }
function vvLH() {
const ta = document.getElementById('vv-editor-body');
if (ta) { const lh = parseFloat(window.getComputedStyle(ta).lineHeight); if (lh > 0) return lh; }
return vvFontSizePx * 1.5;
}
// Setup mode — injected by PHP when navigating from the first-run wizard
let vvSetupConf = <?= json_encode($vv_setup_conf) ?>;
@@ -2840,6 +2844,7 @@ function vvUpdateLineNums() {
const gutter = document.getElementById('vv-ln-gutter');
const ta = document.getElementById('vv-editor-body');
if (!gutter || !ta || vvWordWrap) return;
gutter.style.lineHeight = vvLH() + 'px';
const lines = ta.value.split('\n').length;
const curLn = ta.value.slice(0, ta.selectionStart).split('\n').length;
let html = '';
@@ -2856,9 +2861,9 @@ function vvUpdateCurLine() {
const cl = document.getElementById('vv-cur-line');
if (!cl || !ta || vvWordWrap) return;
const lineH = vvLH();
const padTop = 10; // overlay padding-top
const padTop = parseFloat(window.getComputedStyle(ta).paddingTop);
const lineN = ta.value.slice(0, ta.selectionStart).split('\n').length - 1; // 0-indexed
cl.style.top = (padTop + lineN * lineH - ta.scrollTop) + 'px';
cl.style.top = (ta.offsetTop + padTop + lineN * lineH - ta.scrollTop) + 'px';
cl.style.height = lineH + 'px';
cl.style.display = '';
}