bug: addLine skips the first line, even if it's empty
#46
Reference in New Issue
Block a user
No description provided.
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Minimal Working Example
Expected behavior
If the first line is empty,
addLinewould add the text to the first line.[X] I am running the latest version.
Tick the box if you are running the latest version!
Hello! This is not a bug. The textfield always has one line. If you want your text (something) on position 1, you can use this for example:
Have a nice day!
This sounds kinda weird decision from a usability standpoint.
As a simple example, say I want to create a program that adds/removes something from a textfield every time a button is pressed. In my head, I'd imagine something like this:
However, that won't work. It'll only add from the second line beyond.
Currently, I'd have to do this:
Now you'd have to add a seemingly superfluous
ifstatement to check on a situation that I would imagine would be quite normal. Adding something to the first line instead of the second.It feels like it would be more ergonomic if an empty textfield would be treated as '0' lines. The current way to 'add one line' feels like a hacky workaround. Note that I didn't say it is. If it's intended and documented behaviour, it's not a workaround. However, it really feels like a hacky workaround.
I think
addLineadding to the first line instead of the second would be a more ergonomic and expected behaviour.Hm, thank you. You are probably right. It is one of my goals to make stuff as easy as possible to use/understand. I will change that!
Hey, it should work now. You can see the changes here: a821abe - i figured out, it was already done to behave like you expected it. The problem was, for some reason i accidentally added a space in the first line, so the check if the line is empty, was always false - that's why it was adding a new line instead. However, now should everything work like expected!