-
Notifications
You must be signed in to change notification settings - Fork 262
Description
Bug Report: line_number Component Stops Rendering at Line 99
Issue Summary
The line_number component from @opentui/core v0.1.63 stops rendering line numbers in the gutter at line 99, even when the wrapped textarea contains 100+ lines. Line numbers beyond 99 are not displayed in the gutter, though the textarea content scrolls correctly.
Environment
- Package:
@opentui/core - Version:
0.1.63 - Framework:
@opentui/solidv0.1.63 - OS: Windows 10/11
- Terminal: PowerShell / Linux terminals
Steps to Reproduce
- Create a file with more than 99 lines of content
- Wrap a
textareacomponent withline_numbercomponent - Set
showLineNumbers={true} - Observe the gutter - line numbers stop displaying at line 99
Expected Behavior
Line numbers should display for ALL lines in the file (1, 2, 3, ..., 99, 100, 101, 102, ...), regardless of file size.
Actual Behavior
Line numbers display correctly for lines 1-99, but stop rendering at line 99. Lines 100+ do not show line numbers in the gutter, even though:
- The textarea content scrolls correctly
- The file content is accessible
- Cursor position tracking works correctly (status bar shows correct line numbers like "Ln 274")
Code Example
import { line_number } from "@opentui/core"
import { TextareaRenderable } from "@opentui/core"
// File with 274 lines
const fileContent = "line 1\nline 2\n...\nline 274"
<line_number
fg={theme.textMuted}
bg={theme.backgroundElement}
minWidth={5}
paddingRight={1}
showLineNumbers={true}
>
<textarea
textColor={theme.text}
initialValue={fileContent}
/>
</line_number>Result: Gutter shows line numbers 1-99, but stops at 99. Lines 100-274 have no line numbers displayed.
Additional Context
- The
minWidthprop is set correctly (5 for 3-digit numbers) - The
lineColorsandlineSignsprops work correctly for lines 1-99 - Status bar calculations (using our own logic) correctly show line numbers beyond 99
- The textarea itself handles 100+ lines correctly - only the gutter rendering is affected
- This appears to be a hardcoded limit or rendering bug in the component
Workaround Attempted
We attempted to create a custom line number gutter, but it doesn't sync scroll position with the textarea, making it unusable. The line_number component's automatic scroll synchronization is essential for proper editor functionality.
Impact
This bug affects any editor implementation using line_number with files containing 100+ lines, which is common in real-world codebases.
Related
- Repository: https://github.com/sst/opentui
- Component:
line_numberfrom@opentui/core - Issue affects: All files with 100+ lines