-
Notifications
You must be signed in to change notification settings - Fork 234
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 padding functions #254
Conversation
5b3de33
to
62b8c0e
Compare
@meowgorithm Can I get approval to run the workflows? Thanks. |
Done. Nice work on this one. |
62b8c0e
to
3355f4e
Compare
Can I get someone from @charmbracelet to review this. Thanks. |
Good call on consolidating the two functions. If I'm reading this correctly negative integers applied to |
Yes, you reading this correctly. I am doing the conflict resolution now and will have this updated shortly. |
98a6610
to
16756d2
Compare
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: charmbracelet#252 Signed-off-by: Michael Lorant <[email protected]>
16756d2
to
e261bf8
Compare
Added function comment to explain the relationship between positive and negative values. |
@meowgorithm Any improvements or changes you'd like to make? |
Looking good, @mikelorant—let's get it done. Thanks for the attention to detail! |
The
padLeft
andpadRight
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