From 07cdf7421fc28de23cfc56f203e67e5f4e3a1b73 Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Sat, 31 Jan 2026 13:05:32 +0100 Subject: [PATCH] Fix line number generation in App.tsx --- src/App.tsx | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/App.tsx b/src/App.tsx index d32eafc..0d0b0b7 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -162,10 +162,9 @@ export default function App() { const historyIconSrc = theme === "light" ? historyIconBright : historyIcon; - const lines = useMemo(() => body.split("\n"), [body]); - - return Array.from({ length: count }, (_, index) => index + 1); - }, [body]); + const lines = useMemo(() => body.split(" +"), [body]); + const lineNumbers = useMemo(() => lines.map((_, index) => index + 1), [lines]); const handleTextareaScroll = useCallback((event: React.UIEvent) => { if (!showLineNumbers) return;