From b5a6b556c9c9e6565e5768cf6dc8e30d0b571a12 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Sun, 1 Feb 2026 03:31:24 +0100 Subject: [PATCH] Update visible range calculation in App.tsx --- src/App.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/App.tsx b/src/App.tsx index b33c7f2..4b8f108 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -366,11 +366,12 @@ export default function App() { ); const updateVisibleRange = useCallback(() => { - if (!showLineNumbersActive || !defaultLineHeight) return; + if (!showLineNumbersActive) return; const textarea = textareaRef.current; if (!textarea) return; const scrollTop = textarea.scrollTop; const viewportHeight = textarea.clientHeight; + if (lineTopsRef.current.length === 0) return; const start = findLineAtOffset(scrollTop); const end = findLineAtOffset(scrollTop + viewportHeight); const buffer = 8;