gizak / gizak/termui

When WrapText is enabled, the computation of which rows to show is incorrect.

Open
#301 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Go
Stars
13.6k
Forks
819
PR merge metrics
No merged PRs in 30d

Description

In function **"WrapCells"**, [utils.go](https://github.com/gizak/termui/blob/master/utils.go), you had a declaration of **"i"**. I‘m sure that you want to use it to save the count of line wrap to solve this issue, but you never used it. My suggestion is to have this function return **"wrappedCells"** as well as **"i"**, so that you can handle **"i"** properly in function **"Draw"**, in [list.go](https://github.com/gizak/termui/blob/master/widgets/list.go).

![image](https://user-images.githubusercontent.com/71512917/124119983-c84ed280-daa5-11eb-8e6c-05a2c98ee7b6.png)

Contributor guide

No contributing guide indexed for this repository

Research direction

Read WrapCells in utils.go and then follow how Draw in widgets/list.go uses its result when WrapText is enabled. Verify the handling of the unused line-wrap count against the rows selected for display; done means wrapped list content shows the correct rows without changing behavior when wrapping is disabled.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.