bar.text() breaks when inserting different lenght of strings
sergargar opened this issue · comments
Sergio Garcia commented
Rogério Almeida commented
It doesn't break, there isn't any bug in texts that I know of. Look:
Screen.Recording.2023-03-02.at.12.47.13.mov
Here is the code, if you'd like to try in your terminal:
with alive_bar(1000) as bar:
for i in range(1000):
time.sleep(.01)
bar()
if i // 100 % 2 == 0:
bar.text = f'A long text, that could take your whole line! {i}'
else:
bar.text = f'short text {i}'
Sergio Garcia commented
In my case, I also use a dynamic bar.title
, I think that is the issue.
Rogério Almeida commented
Just for completeness, dynamic titles work too:
Screen.Recording.2023-03-03.at.22.03.01.mov
Rogério Almeida commented
And even both at the same time!!
Screen.Recording.2023-03-03.at.22.07.01.mov
That's it, man, there isn't any bug in these mechanisms.