-
-
Notifications
You must be signed in to change notification settings - Fork 354
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
refactor(text): simplify reflow implementation #290
Conversation
Formatting issue is unrelated to this - seems like a slight change in the current nightly toolchain |
Codecov Report
@@ Coverage Diff @@
## main #290 +/- ##
==========================================
- Coverage 85.00% 82.88% -2.12%
==========================================
Files 38 39 +1
Lines 8507 7532 -975
==========================================
- Hits 7231 6243 -988
- Misses 1276 1289 +13
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs to be rebased, otherwise lgtm, thanks @joshka for extracting this and thanks @lthoerner for taking this much needed task on !
This is @lthoerner's work. I just git-monkied it. Will rebase and merge soon. Likely after the release to give it some time to bake. |
- add `Line::styled()` - add `Line::styled_graphemes()` - add `StyledGrapheme::new()`
rebased on main - requires re-approval as there was a conflict in the rebase in comments in text.rs for |
I recommend updating the commit message to something like |
I'm very confused what's going on with this. Did we only merge the |
yes - the goal on this was to cut down the size of the diff in #259 to something more reviewable. I'd want to take a second step that's similar - find some parts of the rest that are easy to see are useful steps along the way to the implementation that help someone review a part at a time rather than 2000+ lines of churn. https://smartbear.com/learn/code-review/best-practices-for-peer-code-review/ is a helpful article on why. |
Should we update the changelog and the title of the PR then? |
The changelog is automatically updated as part of the release process generally. |
This is a PR that extracts the refactor part of #259, as well as the code for Line->StyledGrapheme. It's intent is to make the review of the actual wrapping code easier. It contains the following commits from 259:
refactor(text): split text::* into separate files (47f8c81)
feat(text): expose graphemes on Line (ec411bb)
Line::styled()
Line::styled_graphemes()
StyledGrapheme::new()
which contains
and adds:
Styled
forStyledGrapheme
from feat: stylization shorthands #283StyledGrapheme::new()
to make the test / docs neaterReview approach
The new code is called out above - no need to review the entire PR, just the bits called out.
Pinging @lthoerner for 👀
The rest of #289 will be rebased on top of this, but this part should be merged quickly to avoid more drift.