fix cursor scroll problem when editing text

When the user edits a todo or project name he can scroll through all
characters to the left until the beginning of the string is reached. However,
when scrolling back into the other direction (towards the end of the string)
scrolling stops before reaching the end.
This change fixes the problem by changing the cursor move condition to rely on
the correct buffer size.