Skip to content

fix: word wrapping doesn't work in TUI pager#886

Open
leanghok120 wants to merge 1 commit intocharmbracelet:masterfrom
leanghok120:master
Open

fix: word wrapping doesn't work in TUI pager#886
leanghok120 wants to merge 1 commit intocharmbracelet:masterfrom
leanghok120:master

Conversation

@leanghok120
Copy link
Copy Markdown

Summary

this pr fixes #878

Problem

running glow -t -w 20 README.md doesn't wrap the words like how it does in the cli version.

Solution

I made it so that when stateShowDocument is set, it updates the m.pager.viewport.width to the value of the -w flag.

After the solution, running glow -t -w 20 README.md wraps the words correctly.

Example

this is the output for glow -t -w 20 README.md:

Before:

glow-before.png

After:

glow-after.png

Tests

  • go test passes

  • I have read CONTRIBUTING.md.

  • I have created a discussion that was approved by a maintainer (for new features).

@leanghok120 leanghok120 requested a review from a team as a code owner February 18, 2026 07:36
@leanghok120 leanghok120 requested review from andreynering and raphamorim and removed request for a team February 18, 2026 07:36
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.

TUI mode does not follow "-w"

1 participant