WACUP

Preview Build Discussion => Preview Build Discussion => Resolved Issues => Topic started by: chamber32 on January 05, 2020, 02:44:44 PM

Title: Now Playing - leading spaces not saved
Post by: chamber32 on January 05, 2020, 02:44:44 PM
When I pad leading spaces to the Now Playing Log Details, it works, but the spaces are lost when closing WACUP.
I tried to use $lpad or $pad, but it didn't seem to work.

c32
Title: Re: Now Playing - leading spaces not saved
Post by: dro on January 06, 2020, 04:12:46 PM
The stripping of whitespace is down to how the setting are saved & something I let happen as trailing whitespace niggles me no end.

What you can do is put a $pad(,5) at the front for 5 spaces & I'll change it to also be able to do $pad(5) without needing to have an input string to start with.

The thing with the pad & lpad methods is it's handling is related to the length of the input string so you have to know the length of that to then get the desired padding which isn't the most obvious of solutions & I think I might consider another method that probably works in a more expected manner & leaving the existing pad/lpad methods alone (apart from working if there's no input string as that's reasonable imho).

-dro
Title: Re: Now Playing - leading spaces not saved
Post by: dro on January 06, 2020, 08:02:11 PM
Changes made for the next build so there'll be a $padout() & $lpadout() which will add the padding onto the string passed instead of only padding if it's below the size provided along with the existing $pad() not needing an input string but still being able to pad with a custom character (e.g. $pad(5, #) will output #####). I think that should cover the possible usage needed without breaking any older behaviour.

-dro
Title: Re: Now Playing - leading spaces not saved
Post by: chamber32 on January 07, 2020, 01:08:59 AM
Thanks for the alternative, works for me!

c32