Open
Conversation
d19b11b to
0978e81
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #190 +/- ##
==========================================
+ Coverage 96.60% 96.89% +0.29%
==========================================
Files 16 17 +1
Lines 1530 1705 +175
==========================================
+ Hits 1478 1652 +174
- Misses 52 53 +1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
22ac3dd to
a0a5a77
Compare
Owner
|
Heyo :) I'll probably take a while to review this. There's a lot going on right now and I'm not sure when I find the mindset to drill into comfy-table once more ❤️ |
0608b9d to
ecd6bbe
Compare
974d6cb to
350e558
Compare
When table has a whitespace as border, it can look quite cramped,
especially when the cells have text with whitespaces. For example, below
is a sample output of a certain table:
Line User Idle Location
-- ------- ----- -------- --------------------------------------
1 con 0 root 07:29:04 -
2 vty 3 root 09:12:23 10.243.214.227
3 vty 5 root 07:09:36 10.243.214.212
* 4 vty 7 admin 00:00:00 fdfd:5c41:712d:d08e:2ce2:7eff:fea5:ae5
As you can see most of the columns (especially the second and third) are
separated by just a single whitespace which makes it rather hard to read.
The idea of smart padding is to detect that two adjacent cells are only
separated by one whitespace, in which case we add one more whitespace
between the two columns. With smart_padding_width=1 the above table would
look like:
Line User Idle Location
-- -------- ------ --------- --------------------------------------
1 con 0 root 07:29:04 -
2 vty 3 root 09:12:23 10.243.214.227
3 vty 5 root 07:09:36 10.243.214.212
* 4 vty 7 admin 00:00:00 fdfd:5c41:712d:d08e:2ce2:7eff:fea5:ae5
It basically tries to make sure texts between adjacent cells have at
least specified number of whitespaces (excluding the border).
Smart padding does not take effect if one of the condition is true:
1. There is no extra space left
2. The left column is right aligned and the right column is left aligned
3. The vertical border is not ' '
350e558 to
ba992fe
Compare
Contributor
Author
|
Hi Nukesor, is it still something you are planning to review? |
This file contains hidden or 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
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.
When table has a whitespace as border, it can look quite cramped, especially when the cells have text with whitespaces. For example, below is a sample output of a certain table:
As you can see most of the columns (especially the second and third) are separated by just a single whitespace which makes it rather hard to read.
The idea of smart padding is to detect that two adjacent cells are only separated by one whitespace, in which case we add one more whitespace between the two columns. With smart_padding_width=1 the above table would look like:
It basically tries to make sure texts between adjacent cells have at least specified number of whitespaces (excluding the border).
Smart padding does not take effect if one of the condition is true: