Skip to content

fix(input): hardcoded width restrictions to fix horizontal scroll - #5

Merged
lupodevelop merged 2 commits into
lupodevelop:mainfrom
gleam-br:issue/3/widget-input-wraps-area-width
Jun 5, 2026
Merged

fix(input): hardcoded width restrictions to fix horizontal scroll#5
lupodevelop merged 2 commits into
lupodevelop:mainfrom
gleam-br:issue/3/widget-input-wraps-area-width

Conversation

@salespaulo

@salespaulo salespaulo commented Jun 4, 2026

Copy link
Copy Markdown
Contributor

Closes #3

What does this PR do?

Fixes a visual bug in etui/src/etui/widgets/input.gleam where the input text truncation and cursor tracking arbitrarily subtracted 2 columns from the allocated area.size.width, causing the cursor to jump prematurely.

Changes:

  • Replaced the hardcoded - 2 margin with w_avail = int.max(1, area.size.width).
  • Applied w_avail evenly to view_start calculation, text truncation, and padding.
  • This ensures the widget smoothly uses 100% of the assigned cell area and tracks the cursor properly.

Tests

  • All 603 tests OK
  • Woking into app and input stop wraps end line and stop scroll jump

Video

Before

Gravacao.de.Tela.2026-06-04.004628.mp4

After

Gravacao.de.Tela.2026-06-04.004304.mp4

@lupodevelop

Copy link
Copy Markdown
Owner

Can you fix the formatting so I can proceed with the merge?

@lupodevelop
lupodevelop merged commit a2646d6 into lupodevelop:main Jun 5, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix: input widget horizontal scroll prematurely wraps and wastes area width

2 participants