Change types
This commit is contained in:
@@ -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`;
|
||||
|
||||
Reference in New Issue
Block a user