aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSeongJae Park <sj38.park@gmail.com>2024-03-24 11:21:03 -0700
committerSeongJae Park <sj38.park@gmail.com>2024-03-24 11:21:03 -0700
commit18c9801bc1cc1686f287abc123bb2f68d706cb59 (patch)
treed1d36fef56b12cb39edfd80f0544f9ff06e39b9d
parent67634d82eb1f3dd09d9f498f6f19d3641accc16c (diff)
downloaddamo-18c9801bc1cc1686f287abc123bb2f68d706cb59.tar.gz
damo_show: Put new line between box and next line if max box height is 1
Boxes add one new line at the end to give bornder between boxes. But the new line is skipped if the max height is 1. Hence, when max height of box is 1 and there is something following the box on the format string, outputs after box comes on same line. Fix it. Signed-off-by: SeongJae Park <sj38.park@gmail.com>
-rw-r--r--damo_show.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/damo_show.py b/damo_show.py
index 289efcd8..5a5d4e53 100644
--- a/damo_show.py
+++ b/damo_show.py
@@ -413,7 +413,10 @@ def set_formats(args, records):
args.format_snapshot_tail = '<total bytes>'
if args.region_box:
- args.format_region = '<box>%s' % default_region_format
+ if args.region_box_min_max_height[1] > 1:
+ args.format_region = '<box>%s' % default_region_format
+ else:
+ args.format_region = '<box>\n%s' % default_region_format
if args.format_snapshot_tail.find('<region box description>') == -1:
args.format_snapshot_tail = ('%s\n<region box description>' %
args.format_record_tail)