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

feat: use tree impl for lists #263

Closed
wants to merge 23 commits into from
Closed

feat: use tree impl for lists #263

wants to merge 23 commits into from

Conversation

caarlos0
Copy link
Member

This will use the tree renderer to render lists too.
Both are very similar if you think about it, the only difference is how they are displayed.

I ended up moving a lot of stuff around, and removing some other things - mainly filter, hide, etc, which I think are more behavior-related than styling, so maybe they should be in the bubble that uses list instead of here?

Anyway, let me know what you think!

PS: all tests are creating golden files, which you can inspect to see how the output looks like :)

dependabot bot and others added 14 commits December 7, 2023 08:55
Bumps [actions/setup-go](https://github.com/actions/setup-go) from 4 to 5.
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](actions/setup-go@v4...v5)

---
updated-dependencies:
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
An empty string could not have padding applied on the right side.

Issue: #252

Signed-off-by: Michael Lorant <michael.lorant@nine.com.au>
Apply gofumpt to all files to correct minor formatting issues.

Signed-off-by: Michael Lorant <michael.lorant@nine.com.au>
The `padLeft` and `padRight` functions were nearly identical and could
benefit from being refactored to share common code.

A new function called `pad` was added that applies padding based on the
sign of the amount of padding needed. A positive value applies padding
to the right side while a negative value applies padding to the left
side.

Issue: #252

Signed-off-by: Michael Lorant <michael.lorant@nine.com.au>
The function `maxRuneWidth` was using a flawed approach by only
evaluating strings based on each rune. The `uniseg` package provides a
more accurate method based on grapheme clusters.

This change switches over to the improved implementation which should
achieve better results when determining the maximum width of all
grapheme clusters in a string.

Signed-off-by: Michael Lorant <michael.lorant@nine.com.au>
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
Signed-off-by: Carlos Alexandro Becker <caarlos0@users.noreply.github.com>
@caarlos0 caarlos0 added the enhancement New feature or request label Feb 15, 2024
@caarlos0 caarlos0 self-assigned this Feb 15, 2024
@caarlos0
Copy link
Member Author

I call this "the frankenlistre"

CleanShot 2024-02-15 at 16 19 40@2x

@caarlos0
Copy link
Member Author

todo

  • looking into the examples, probably will have to implement At(int)

@caarlos0 caarlos0 mentioned this pull request Feb 16, 2024
@caarlos0
Copy link
Member Author

superseeded by #264

@caarlos0
Copy link
Member Author

caarlos0 commented Mar 1, 2024

closing in favor of #264

@caarlos0 caarlos0 closed this Mar 1, 2024
@caarlos0 caarlos0 deleted the list-tree branch March 1, 2024 12:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants