[GH-ISSUE #452] line_number gutter stops displaying line numbers beyond line 99 #889

Open
opened 2026-03-14 08:56:30 +03:00 by kerem · 1 comment
Owner

Originally created by @PersistenceOS on GitHub (Dec 28, 2025).
Original GitHub issue: https://github.com/anomalyco/opentui/issues/452

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/solid v0.1.63
  • OS: Windows 10/11
  • Terminal: PowerShell / Linux terminals

Steps to Reproduce

  1. Create a file with more than 99 lines of content
  2. Wrap a textarea component with line_number component
  3. Set showLineNumbers={true}
  4. 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 minWidth prop is set correctly (5 for 3-digit numbers)
  • The lineColors and lineSigns props 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.

Originally created by @PersistenceOS on GitHub (Dec 28, 2025). Original GitHub issue: https://github.com/anomalyco/opentui/issues/452 # 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/solid` v0.1.63 - **OS**: Windows 10/11 - **Terminal**: PowerShell / Linux terminals ## Steps to Reproduce 1. Create a file with more than 99 lines of content 2. Wrap a `textarea` component with `line_number` component 3. Set `showLineNumbers={true}` 4. 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 ```tsx 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 `minWidth` prop is set correctly (5 for 3-digit numbers) - The `lineColors` and `lineSigns` props 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_number` from `@opentui/core` - Issue affects: All files with 100+ lines
Author
Owner

@PersistenceOS commented on GitHub (Jan 20, 2026):

Hello, Was this ever reviewed and resolved? if so what release?

Thank you,

Leo

<!-- gh-comment-id:3774552480 --> @PersistenceOS commented on GitHub (Jan 20, 2026): Hello, Was this ever reviewed and resolved? if so what release? Thank you, Leo
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/opentui#889
No description provided.