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

Wrap word support ansi #155

Merged
merged 3 commits into from Apr 23, 2021
Merged

Wrap word support ansi #155

merged 3 commits into from Apr 23, 2021

Conversation

nam-hle
Copy link
Collaborator

@nam-hle nam-hle commented Apr 21, 2021

This PR supports ANSI word wrapping (#11). Here is my solution:

  • Apply our logic on an ANSI-stripped string to get strings' lengths and offset to the next string (because of trim)
  • Then use that information to slice real string

TODO: Find out the way to split ANSI strings by newline character in wrapCell.ts

@coveralls
Copy link

coveralls commented Apr 21, 2021

Pull Request Test Coverage Report for Build 296

  • 33 of 33 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.01%) to 99.796%

Totals Coverage Status
Change from base Build 288: 0.01%
Covered Lines: 365
Relevant Lines: 365

💛 - Coveralls

`${openBold}${openRed}Lorem${closeRed}${closeBold}`,
`${openBold}${openRed}ipsum${closeRed}${closeBold}`,
`${openBold}${openRed}dolor${closeRed}${closeBold}`,
`${openBold}${openRed}sit${closeBold}${closeRed}`],
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's weird but works

@nam-hle nam-hle marked this pull request as draft April 21, 2021 14:14
@nam-hle nam-hle marked this pull request as ready for review April 22, 2021 02:06
@gajus gajus merged commit 07285ae into gajus:master Apr 23, 2021
@gajus
Copy link
Owner

gajus commented Apr 23, 2021

🎉 This PR is included in version 6.5.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@gajus gajus added the released label Apr 23, 2021
@nam-hle nam-hle deleted the ansi-2 branch April 24, 2021 00:22
nam-hle added a commit to nam-hle/table that referenced this pull request Apr 24, 2021
* Wrap word support ansi

* Refactor

* Implement split ansi string

Co-authored-by: Nam Hoang Le <nam.hoang.le@mgm-tp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants