Change types

This commit is contained in:
mcDandy
2026-02-21 16:30:52 +01:00
parent 3e7560a565
commit 4bc2b67a85
4 changed files with 46 additions and 19 deletions
+6 -3
View File
@@ -27,6 +27,11 @@ const FUNCTIONS = new Set([
"worley", "cellular_noise", "voronoi_noise", "plasma", "turbulence", "plasma_noise"
]);
const BRACKET_PAIRS = {
'(': ')',
'[': ']',
'{': '}'
};
const OPENING_BRACKETS = new Set(['(', '[', '{']);
const CLOSING_BRACKETS = new Set([')', ']', '}']);
@@ -318,10 +323,8 @@ function attachLineNumbers(widget) {
const rawLines = inputEl.value.split("\n");
const paddingTop = parseFloat(inputStyle.paddingTop) || 0;
const paddingBottom = parseFloat(inputStyle.paddingBottom) || 0;
const paddedScrollHeight = Math.max(0, inputEl.scrollHeight - paddingTop - paddingBottom);
const textLineCount = Math.max(1, rawLines.length);
const visibleLineCount = Math.max(1, Math.ceil(paddedScrollHeight / lineHeightPx));
const lineCount = Math.max(textLineCount, visibleLineCount);
const lineCount = textLineCount;
gutterContent.textContent = Array.from({ length: lineCount }, (_, i) => String(i + 1)).join("\n");
gutterContent.style.height = `${lineCount * lineHeightPx + paddingTop + paddingBottom}px`;
gutter.style.height = `${editorContainer.clientHeight}px`;