Skip to content

Commit

Permalink
Ignore width/height settings in viewport's style settings
Browse files Browse the repository at this point in the history
The Lip Gloss width and height settings compete with the main
width/height settings and can result in funny rendering and generally
cause confusion.
  • Loading branch information
meowgorithm committed Jan 20, 2022
1 parent 746834a commit 7ecce3f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion viewport/viewport.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,10 @@ func (m Model) View() string {
extraLines = strings.Repeat("\n", max(0, m.Height-len(lines)))
}

return m.Style.Render(strings.Join(lines, "\n") + extraLines)
return m.Style.Copy().
UnsetWidth().
UnsetHeight().
Render(strings.Join(lines, "\n") + extraLines)
}

func clamp(v, low, high int) int {
Expand Down

0 comments on commit 7ecce3f

Please sign in to comment.