summaryrefslogtreecommitdiff
path: root/cmd2
diff options
context:
space:
mode:
authorTodd Leonhardt <todd.leonhardt@gmail.com>2021-03-01 22:58:12 -0500
committerGitHub <noreply@github.com>2021-03-01 22:58:12 -0500
commitd4035b43d3a7edda50908f2e6bb090381831975d (patch)
tree54b2bd24fa31bd82a42c57eed8c234ee5a131936 /cmd2
parent97f14b266e038a5d4acf7841d538cf37f066d328 (diff)
parentecba81e98471f92aaccb853630790708f0d21aaf (diff)
downloadcmd2-git-d4035b43d3a7edda50908f2e6bb090381831975d.tar.gz
Merge pull request #1066 from python-cmd2/table_newline
Fixed issue where TableCreator was tossing blank last lines
Diffstat (limited to 'cmd2')
-rw-r--r--cmd2/table_creator.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/cmd2/table_creator.py b/cmd2/table_creator.py
index 8dcd80f0..d159ddbf 100644
--- a/cmd2/table_creator.py
+++ b/cmd2/table_creator.py
@@ -351,6 +351,10 @@ class TableCreator:
last_word = data_line_index == len(data_str_lines) - 1 and char_index == len(data_line)
add_word(cur_word_buf.getvalue(), last_word)
+ # If the last line is empty, then add a newline
+ elif data_line_index == len(data_str_lines) - 1:
+ wrapped_buf.write('\n')
+
# Stop line loop if we've written to max_lines
if total_lines == max_lines:
# If this isn't the last data line and there is space