Skip to content

Commit

Permalink
multiple margin by 2 to account for margin-right
Browse files Browse the repository at this point in the history
Co-authored-by: Maximilian Moehl <maximilian@moehl.eu>
  • Loading branch information
jahvon and maxmoehl committed Aug 30, 2024
1 parent 44a54a6 commit b79a5e4
Show file tree
Hide file tree
Showing 27 changed files with 289 additions and 283 deletions.
4 changes: 2 additions & 2 deletions ansi/blockstack.go
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,10 @@ func (s BlockStack) Margin() uint {

// Width returns the available rendering width.
func (s BlockStack) Width(ctx RenderContext) uint {
if s.Indent()+s.Margin() > uint(ctx.options.WordWrap) {
if s.Indent()+s.Margin()*2 > uint(ctx.options.WordWrap) {
return 0
}
return uint(ctx.options.WordWrap) - s.Indent() - s.Margin()
return uint(ctx.options.WordWrap) - s.Indent() - s.Margin()*2
}

// Parent returns the current BlockElement's parent.
Expand Down
30 changes: 15 additions & 15 deletions ansi/testdata/TestRendererIssues/106.golden

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions ansi/testdata/TestRendererIssues/107.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions ansi/testdata/TestRendererIssues/117.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions ansi/testdata/TestRendererIssues/149.golden

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit b79a5e4

Please sign in to comment.