Skip to content

Commit

Permalink
small fix for table display on small width terminals (error message)
Browse files Browse the repository at this point in the history
  • Loading branch information
victordomingos committed Mar 15, 2020
1 parent 3a15cc0 commit e90ff18
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions count_files/utils/viewing_modes.py
Expand Up @@ -112,6 +112,10 @@ def show_2columns(data: List[tuple],
max_word_width,
MAX_TABLE_WIDTH)

if term_width < (max_word_width + freq_col_width + 5):
print("Oops! There isn't enough horizontal space to display the frequency table. \n")
return

header = f" {'EXTENSION'.ljust(ext_col_width)} | {'FREQ.'.ljust(freq_col_width)} "
sep_left = (ext_col_width + 2) * '-'
sep_center = "+"
Expand Down

0 comments on commit e90ff18

Please sign in to comment.