Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs!: add additional info on Width behaviour #450

Open
wants to merge 1 commit into
base: v2-exp
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions set.go
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,9 @@
return s
}

// Width sets the width of the block before applying margins. The width, if
// set, also determines where text will wrap.
// Width sets the width of the block before applying margins. This means your
// styled content will exactly equal the size set here. Text will wrap based on
// Padding and Borders set on the style.
func (s Style) Width(i int) Style {
s.set(widthKey, i)
return s
Expand Down Expand Up @@ -710,19 +711,19 @@
left = i[0]
right = i[0]
ok = true
case 2: //nolint:gomnd

Check failure on line 714 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (ubuntu-latest)

Magic number: 2, in <case> detected (mnd)

Check failure on line 714 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (macos-latest)

Magic number: 2, in <case> detected (mnd)

Check failure on line 714 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (ubuntu-latest)

Magic number: 2, in <case> detected (mnd)

Check failure on line 714 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (macos-latest)

Magic number: 2, in <case> detected (mnd)

Check failure on line 714 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (windows-latest)

Magic number: 2, in <case> detected (mnd)

Check failure on line 714 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (windows-latest)

Magic number: 2, in <case> detected (mnd)
top = i[0]
bottom = i[0]
left = i[1]
right = i[1]
ok = true
case 3: //nolint:gomnd

Check failure on line 720 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (ubuntu-latest)

Magic number: 3, in <case> detected (mnd)

Check failure on line 720 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (macos-latest)

Magic number: 3, in <case> detected (mnd)

Check failure on line 720 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (ubuntu-latest)

Magic number: 3, in <case> detected (mnd)

Check failure on line 720 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (macos-latest)

Magic number: 3, in <case> detected (mnd)

Check failure on line 720 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (windows-latest)

Magic number: 3, in <case> detected (mnd)

Check failure on line 720 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (windows-latest)

Magic number: 3, in <case> detected (mnd)
top = i[0]
left = i[1]
right = i[1]
bottom = i[2]
ok = true
case 4: //nolint:gomnd

Check failure on line 726 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (ubuntu-latest)

Magic number: 4, in <case> detected (mnd)

Check failure on line 726 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (macos-latest)

Magic number: 4, in <case> detected (mnd)

Check failure on line 726 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (ubuntu-latest)

Magic number: 4, in <case> detected (mnd)

Check failure on line 726 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (macos-latest)

Magic number: 4, in <case> detected (mnd)

Check failure on line 726 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (windows-latest)

Magic number: 4, in <case> detected (mnd)

Check failure on line 726 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (windows-latest)

Magic number: 4, in <case> detected (mnd)
top = i[0]
right = i[1]
bottom = i[2]
Expand All @@ -743,19 +744,19 @@
left = i[0]
right = i[0]
ok = true
case 2: //nolint:gomnd

Check failure on line 747 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (ubuntu-latest)

Magic number: 2, in <case> detected (mnd)

Check failure on line 747 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (macos-latest)

Magic number: 2, in <case> detected (mnd)

Check failure on line 747 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (ubuntu-latest)

Magic number: 2, in <case> detected (mnd)

Check failure on line 747 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (macos-latest)

Magic number: 2, in <case> detected (mnd)

Check failure on line 747 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (windows-latest)

Magic number: 2, in <case> detected (mnd)

Check failure on line 747 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (windows-latest)

Magic number: 2, in <case> detected (mnd)
top = i[0]
bottom = i[0]
left = i[1]
right = i[1]
ok = true
case 3: //nolint:gomnd

Check failure on line 753 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (ubuntu-latest)

Magic number: 3, in <case> detected (mnd)

Check failure on line 753 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (macos-latest)

Magic number: 3, in <case> detected (mnd)

Check failure on line 753 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (ubuntu-latest)

Magic number: 3, in <case> detected (mnd)

Check failure on line 753 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (macos-latest)

Magic number: 3, in <case> detected (mnd)

Check failure on line 753 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (windows-latest)

Magic number: 3, in <case> detected (mnd)

Check failure on line 753 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (windows-latest)

Magic number: 3, in <case> detected (mnd)
top = i[0]
left = i[1]
right = i[1]
bottom = i[2]
ok = true
case 4: //nolint:gomnd

Check failure on line 759 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (ubuntu-latest)

Magic number: 4, in <case> detected (mnd)

Check failure on line 759 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (macos-latest)

Magic number: 4, in <case> detected (mnd)

Check failure on line 759 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (ubuntu-latest)

Magic number: 4, in <case> detected (mnd)

Check failure on line 759 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (macos-latest)

Magic number: 4, in <case> detected (mnd)

Check failure on line 759 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (windows-latest)

Magic number: 4, in <case> detected (mnd)

Check failure on line 759 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (windows-latest)

Magic number: 4, in <case> detected (mnd)
top = i[0]
right = i[1]
bottom = i[2]
Expand All @@ -776,19 +777,19 @@
left = i[0]
right = i[0]
ok = true
case 2: //nolint:gomnd

Check failure on line 780 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (ubuntu-latest)

Magic number: 2, in <case> detected (mnd)

Check failure on line 780 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (macos-latest)

Magic number: 2, in <case> detected (mnd)

Check failure on line 780 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (ubuntu-latest)

Magic number: 2, in <case> detected (mnd)

Check failure on line 780 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (macos-latest)

Magic number: 2, in <case> detected (mnd)

Check failure on line 780 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (windows-latest)

Magic number: 2, in <case> detected (mnd)

Check failure on line 780 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (windows-latest)

Magic number: 2, in <case> detected (mnd)
top = i[0]
bottom = i[0]
left = i[1]
right = i[1]
ok = true
case 3: //nolint:gomnd

Check failure on line 786 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (ubuntu-latest)

Magic number: 3, in <case> detected (mnd)

Check failure on line 786 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (macos-latest)

Magic number: 3, in <case> detected (mnd)

Check failure on line 786 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (ubuntu-latest)

Magic number: 3, in <case> detected (mnd)

Check failure on line 786 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (macos-latest)

Magic number: 3, in <case> detected (mnd)

Check failure on line 786 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (windows-latest)

Magic number: 3, in <case> detected (mnd)

Check failure on line 786 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (windows-latest)

Magic number: 3, in <case> detected (mnd)
top = i[0]
left = i[1]
right = i[1]
bottom = i[2]
ok = true
case 4: //nolint:gomnd

Check failure on line 792 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (ubuntu-latest)

Magic number: 4, in <case> detected (mnd)

Check failure on line 792 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (macos-latest)

Magic number: 4, in <case> detected (mnd)

Check failure on line 792 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (ubuntu-latest)

Magic number: 4, in <case> detected (mnd)

Check failure on line 792 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (macos-latest)

Magic number: 4, in <case> detected (mnd)

Check failure on line 792 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (windows-latest)

Magic number: 4, in <case> detected (mnd)

Check failure on line 792 in set.go

View workflow job for this annotation

GitHub Actions / lint / lint-soft (windows-latest)

Magic number: 4, in <case> detected (mnd)
top = i[0]
right = i[1]
bottom = i[2]
Expand Down
Loading