-
Notifications
You must be signed in to change notification settings - Fork 106
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added code to clear the text #503
Added code to clear the text #503
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks like a great change! See below for one small comment -
core/text_view.js
Outdated
@@ -179,6 +179,10 @@ TextView.prototype.setText = function (text, redraw) { | |||
}; | |||
|
|||
TextView.prototype.clearText = function () { | |||
if (this.text) { | |||
this.setText(' '.repeat(this.text.length)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use this.fillChar
here instead of a literal space?
…yHarwood/enigma-bbs into bugfix/TextView_clearText
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good suggestion. Thanks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me, I'll wait for @NuSkooler in case he has any concerns but thanks so much for the PR, keep 'em coming :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome, I like simple! Thanks!
I noticed the text in the error view was not being cleared after the error was corrected. For example, "Username is too short".
I can think of a few different ways this could have been fixed. I try to keep it simple. If you prefer a different approach to resolving this, please don't hesitate to let me know.
Thanks!