Due to East East Asian chars being more than two columns wide on terminal, video list often was misaligned and looked like this:
(Whole table doesn't even fit into the terminal window)
Added util.correct_truncate method which truncates a string taking into account East Asian width chars. util.ea_pad' now pads correctly.
Also content.generate_songlist_display and ListView.content functions now use custom string formatting instead of the default one and output correct table:
Note: the util.real_len function doesn't take into account Unicode emojis. Because of that, the table is still a bit misaligned (line 12 & 20).
I suggest to let wcwidth in real_len function take care of it, it should solve the problem. If the additional dependency is okay.
Due to East East Asian chars being more than two columns wide on terminal, video list often was misaligned and looked like this:
(Whole table doesn't even fit into the terminal window)
Added
util.correct_truncate
method which truncates a string taking into account East Asian width chars.util.
ea_pad' now pads correctly. Alsocontent.generate_songlist_display
andListView.content
functions now use custom string formatting instead of the default one and output correct table:Note: the
util.real_len
function doesn't take into account Unicode emojis. Because of that, the table is still a bit misaligned (line 12 & 20). I suggest to let wcwidth inreal_len
function take care of it, it should solve the problem. If the additional dependency is okay.