Page 1 of 1

[wheybags] [0.17.4] Color format counts as string

Posted: Sat Mar 02, 2019 2:07 am
by Roang
What did you do?
I added colour to a train station name and deleted the string.
Station name - empty - edit.png
Station name - empty - edit.png (21.84 KiB) Viewed 1449 times
What happened?
I could name the station with an empty (no symbols shown) string.
Station name - empty - gui.png
Station name - empty - gui.png (25.44 KiB) Viewed 1449 times
What did you expect to happen instead?
There should be a warning that a station name cannot be empty
Warning
Warning
Station name - empty - edit.png (15.01 KiB) Viewed 1449 times

Re: [wheybags] [0.17.4] Color format counts as string

Posted: Thu Apr 11, 2019 10:31 am
by wheybags
Thanks for the report.
In the next version, you will be forced to close color tags, so to replicate this you would have to do something that makes no sense - start and end a color tag without putting any text in between, eg:

Code: Select all

[color=red][/color]
Whenever you use backspace, the string is cleaned up after the deletion, so eg if you had:

Code: Select all

123[color=red]a[/color]
with your cursor after the a, then hit backspace, the empty color tag will be removed.

Disallowing this case would be awkward, as it would probably imply running the cleanup code after every insertion of text too.
The difference is, you can generate empty sections like this with backspace by doing something quite sensible and normal, but to make an empty section with insertion you kinda have to really try.
For that reason, I don't think it's worth it, so I will put this bug in "Won't fix" for now.