diff options
author | fxxf <ff@fxxf.me> | 2022-06-19 18:47:48 +0300 |
---|---|---|
committer | Eli Schwartz <eschwartz93@gmail.com> | 2022-06-24 00:17:56 -0400 |
commit | 650cea3d08693b83892b1d63b947b7c760cdf639 (patch) | |
tree | 4b80fcb741c3d37dc26ce65380082d5f77dbc617 | |
parent | 1a3d29dd0e535dc18039e270e47a2ba2f9c9d3a3 (diff) | |
download | meson-650cea3d08693b83892b1d63b947b7c760cdf639.zip meson-650cea3d08693b83892b1d63b947b7c760cdf639.tar.gz meson-650cea3d08693b83892b1d63b947b7c760cdf639.tar.bz2 |
fix: handle the case where the last item of `four_column` results in being < 1 (COLUMNS <= 60) by falling back to `_col`, relevant issue #10211
-rw-r--r-- | mesonbuild/mconf.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/mesonbuild/mconf.py b/mesonbuild/mconf.py index cd2b2e3..aa49949 100644 --- a/mesonbuild/mconf.py +++ b/mesonbuild/mconf.py @@ -112,7 +112,8 @@ class Conf: """ total_width = shutil.get_terminal_size(fallback=(160, 0))[0] _col = max(total_width // 5, 20) - four_column = (_col, _col, _col, total_width - (3 * _col)) + last_column = total_width - (3 * _col) + four_column = (_col, _col, _col, last_column if last_column > 1 else _col) # In this case we don't have the choices field, so we can redistribute # the extra 40 characters to val and desc three_column = (_col, _col * 2, total_width // 2) |