-
Notifications
You must be signed in to change notification settings - Fork 252
Open
Description
Description
Issue: Tables truncate unexpectedly unless both specific style and large word_wrap values are provided
Current Behavior:
- Default settings: tables truncate (2 truncation characters found)
style='dark'alone: tables still truncate (2 truncation characters)word_wrap=140alone: tables still truncate (2 truncation characters)style='dark', word_wrap=140: tables display properly (0 truncation characters)
Expected Behavior: Tables should display without truncation when provided adequate width, regardless of style choice
Root Cause Analysis:
In ansi/blockstack.go:65, the width calculation uses multiplication:
// Line 65 - Current implementation
return uint(ctx.options.WordWrap) - s.Indent()*s.Margin()
Example Calculation (with dark style, margin=2, indent=0):
- Current: 80 - (0 * 2) = 80 chars (too wide for complex tables)
- Proposed: 80 - 0 - 2 = 78 chars (more accurate width calculation)
Proposed Fix:
Change multiplication to addition:
// Proposed fix
return uint(ctx.options.WordWrap) - s.Indent() - s.Margin()
Test Case:
| Feature | Basic Plan | Professional Plan | Enterprise Plan | Description |
|---------|------------|-------------------|-----------------|-------------|
| **API Access** | ❌ Limited | ✅ Full REST API | ✅ Advanced GraphQL features | Programmatic access to all platform features |
| **Support** | Email only | Priority email + chat | 24/7 phone support | Different levels of customer support availability |
Impact: This change would provide more accurate table width calculations and prevent unexpected truncation with standard word_wrap values.
Is this the intended calculation method?
### Version
master
### Environment
all (osx) / all (wezterm + Ghostty tested)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels