kimtore / pms

Practical Music Search is an interactive Vim-like console client for the Music Player Daemon.
https://ambientsound.github.io/pms/
MIT License
250 stars 23 forks source link

Wrong column widths in playlist #21

Closed lahwaacz closed 7 years ago

lahwaacz commented 9 years ago

The algorithm for adjusting width of columns in the playlist does not take into account the data to be displayed. If the song title is too long, its column will span most of the screen, leaving only a few characters for the artist column in some cases, regardless of the actual length of the artist text. And the track number column displays only one digit.

lahwaacz commented 9 years ago

With a 22-song album in the playlist, ordered by track number, the "No" column displays the following:

1 
2 
3 
4 
5 
6 
7 
8 
9 
1 
11
12
13
14
15
16
17
18
19
2 
21
22

Somehow the trailing zeros are stripped...

kimtore commented 9 years ago

Hi @lahwaacz. Which version are you running? Do you mind posting a screenshot?

lahwaacz commented 9 years ago

This condition is wrong, you have probably intended to strip leading zeros, but the code in fact ignores zeros at any position.

I will try to reproduce the problem with column widths and post a screenshot when my current playlist ends.

lahwaacz commented 9 years ago

The screenshots: it looks fine in fullscreen, but you can see the issue in half-split screen -- the artist column disappeared completely, leaving only the overly-wide title column.

kimtore commented 9 years ago

Great, thanks for the screenshots. I'll look into the issue. This is running on the latest master commit, right?

lahwaacz commented 9 years ago

Right.

kimtore commented 7 years ago

Sorry about bumping this old thread. This bug is unlikely to get fixed in the old version. There is a new master version where this glitch is not present. Feel free to give it a go?

lahwaacz commented 7 years ago

I don't use pms anymore, so if you say it's fixed in master, I have no problem closing this.