diff options
author | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2020-06-01 00:33:28 -0400 |
---|---|---|
committer | Kevin Van Brunt <kmvanbrunt@gmail.com> | 2020-06-01 00:33:28 -0400 |
commit | cd5b98a2057c50e625eaf85cbe82f62426e49b07 (patch) | |
tree | 39fe46419a3ccb8731c4bc900532d563a4bc63ac /cmd2/argparse_completer.py | |
parent | d15439225fda1c70c685f678871903b9c8694720 (diff) | |
download | cmd2-git-cd5b98a2057c50e625eaf85cbe82f62426e49b07.tar.gz |
Changed how SimpleTable creates divider when divider_char is wide. It no longer stretches the width of the table.
Diffstat (limited to 'cmd2/argparse_completer.py')
-rw-r--r-- | cmd2/argparse_completer.py | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/cmd2/argparse_completer.py b/cmd2/argparse_completer.py index a8bb6390..4598bee6 100644 --- a/cmd2/argparse_completer.py +++ b/cmd2/argparse_completer.py @@ -484,9 +484,8 @@ class ArgparseCompleter: # Create a table that's over half the width of the terminal. # This will force readline to place each entry on its own line. - divider_char = None min_width = int(shutil.get_terminal_size().columns * 0.6) - base_width = SimpleTable.base_width(2, divider_char=divider_char) + base_width = SimpleTable.base_width(2) initial_width = base_width + token_width + desc_width if initial_width < min_width: @@ -496,7 +495,7 @@ class ArgparseCompleter: cols.append(Column(destination.upper(), width=token_width)) cols.append(Column(desc_header, width=desc_width)) - hint_table = SimpleTable(cols, divider_char=divider_char) + hint_table = SimpleTable(cols) self._cmd2_app.completion_header = hint_table.generate_header() self._cmd2_app.display_matches = [hint_table.generate_data_row([item, item.description]) for item in completions] |