-
Notifications
You must be signed in to change notification settings - Fork 0
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
Port resize into a method outside of lily objects #51
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Codecov Report
@@ Coverage Diff @@
## master #51 +/- ##
==========================================
- Coverage 88.12% 87.92% -0.21%
==========================================
Files 34 35 +1
Lines 1768 1813 +45
Branches 281 301 +20
==========================================
+ Hits 1558 1594 +36
- Misses 175 183 +8
- Partials 35 36 +1
Continue to review full report at Codecov.
|
This was referenced Feb 21, 2021
mrz1988
added a commit
that referenced
this pull request
Feb 22, 2021
Summary ======= Remove old styling by index and regex on LilyString and LilyBlock objects, and implement a new `highlight()` utility method that does a similar thing. Technical Details ============= Support has been removed for the following methods: - LilyString.style_chars - LilyString.style_char - LilyString.style_regex - LilyBlock.style_regex Why? ==== This continues along the theme of #51 to reduce the footprint and responsibility of Lily object classes, and instead provide powerful, intuitive utility functions. Prefer universal tools rather than forcing casts.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary
Remove all resize logic out of LilyBlock and LilyString classes, and create a new
resize()
helper method. The new resize method:Technical Implications
resize_x
andresize_y
.LilyBlock.normalize()
is now replaced byresize(block)
.grow()
now returns a LilyString if an iterable of length 1 is added in (instead of a 1-row LilyBlock).Why?
As the repo grows, it makes sense to keep lily text objects a bit thinner, and have powerful helper methods do most of the heavy lifting. This is advantageous for a few reasons: