While using form fields I stumbled upon the following behavior of dynamically-sized fields. AFAICT, passing a right arrow key event to the form driver leads to appending of spaces to the field buffer. I.e., this:
case KEY_RIGHT:
form_driver(f, REQ_NEXT_CHAR);
break;
when the cursor is at the end of the field string will append spaces to the field buffer. I am baffled as to how this is the default behavior. IMHO, hard stopping at the end of the field buffer string would be the correct, intuitive behavior, and spaces should be appended only when the user explicitly does so.
Reading the source code I see this is tied to a compatibility macro(?) called GROW_IF_NAVIGATE? I see this as a prime example of a simple enhancement that allows the user to opt out of this behavior. In the meantime what are my options? Just trim?
EDIT: the behavior controlled by this macro is more bizarre than I originally thought. It only limits growth when moving after the end of the field as specified in the field creation. IOW, when the macro is disabled (0), after filling some part of the field the growth is still allowed until the cursor reaches the end of the field where the growth indeed stops. Trimming is perhaps the only recourse here.