Update visible range calculation in App.tsx

This commit is contained in:
2026-02-01 03:31:24 +01:00
parent 51e8fea77b
commit b5a6b556c9

View File

@@ -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;