aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLesmiscore <nao20010128@gmail.com>2022-03-06 17:11:10 +0900
committerLesmiscore <nao20010128@gmail.com>2022-03-06 17:11:10 +0900
commit1ed7953a7405a8613b4a6d9ada1f91c04edb83c0 (patch)
tree70de242f1c1d378a2098e46abc35e269ab157bea
parentd49669acad71f640ffd8b78f0ea7911ae1f67720 (diff)
downloadhypervideo-pre-1ed7953a7405a8613b4a6d9ada1f91c04edb83c0.tar.lz
hypervideo-pre-1ed7953a7405a8613b4a6d9ada1f91c04edb83c0.tar.xz
hypervideo-pre-1ed7953a7405a8613b4a6d9ada1f91c04edb83c0.zip
[utils] render_table: Fix character calculation for removing extra gap
without this fix, the column next to delimiter will lack leading spaces on terminal (see https://github.com/yt-dlp/yt-dlp/pull/920#issuecomment-1059914615 for the situation)
-rw-r--r--yt_dlp/utils.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/yt_dlp/utils.py b/yt_dlp/utils.py
index 87463c999..8256d543e 100644
--- a/yt_dlp/utils.py
+++ b/yt_dlp/utils.py
@@ -3485,7 +3485,7 @@ def render_table(header_row, data, delim=False, extra_gap=0, hide_empty=False):
extra_gap += 1
if delim:
table = [header_row, [delim * (ml + extra_gap) for ml in max_lens]] + data
- table[1][-1] = table[1][-1][:-extra_gap] # Remove extra_gap from end of delimiter
+ table[1][-1] = table[1][-1][:-extra_gap * len(delim)] # Remove extra_gap from end of delimiter
for row in table:
for pos, text in enumerate(map(str, row)):
if '\t' in text: