![](https://secure.gravatar.com/avatar/2e63073416b871d069a6d21c17a2f38c.jpg?s=120&d=mm&r=g)
Salutations,
I currently have a textarea instance external to a form, and when a user cancels or accepts the edit I want to clear the textarea - clear the window, clear the buffer, reset the input-pointer. However, it looks like the clear method only clears the window and nothing else. How do I go about clearing the buffer, resetting the input pointer, and moving the cursor back to the beginning of the textarea?
Thank you in advance, Lance
hobo@sdf.org SDF Public Access UNIX System - https://sdf.org
![](https://secure.gravatar.com/avatar/830d379c4e4a66d9cc0ade4357c29127.jpg?s=120&d=mm&r=g)
Hello Lance,
However, it looks like the clear method only clears the window and nothing else.
I checked, this is correct.
How do I go about clearing the buffer, resetting the input pointer, and moving the cursor back to the beginning of the textarea?
The textarea is unfortunately not finished yet, so there is missing functionality. A general editing widget requires somewhat more effort than a simple one line input field.
What you are looking for is the textarea equivalent of "reset-field", which doesn't exist yet. Implementing reset as a generic function similar to clear makes most sense, so I will try to make that in the next few days. In the meantime, you can set the pointers and the internal positions to 0.
Anton
![](https://secure.gravatar.com/avatar/830d379c4e4a66d9cc0ade4357c29127.jpg?s=120&d=mm&r=g)
Hallo Lance,
How do I go about clearing the buffer, resetting the input pointer, and moving the cursor back to the beginning of the textarea?
I have just pushed a commit that adds a generic function reset, which first clears the textarea (field, form) with the background char, then resets the internal variables.
In the default keymap, it is bound to ^R, but you can change that if it doesn't make sense to you.
Anton
participants (2)
-
Anton Vidovic
-
hobo@SDF.ORG