-
Notifications
You must be signed in to change notification settings - Fork 133
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
[5/5] Implementing the text widget. #36
Conversation
Pull Request Test Coverage Report for Build 25
💛 - Coveralls |
Pull Request Test Coverage Report for Build 57
💛 - Coveralls |
widgets/text/text.go
Outdated
t.givenWOpts = newGivenWOpts() | ||
t.scroll = newScrollTracker(t.opts) | ||
t.lastWidth = 0 | ||
t.newText = true |
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.
Should this be true if there is no content and has been reset (reset kind of gives the impression on new text was added yet).
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 point, renamed newText to contentChanged.
break | ||
} | ||
|
||
if r == '\n' { |
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.
Do we actually need this statement?
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.
Yes, otherwise we print out the newline rune below which adds an empty line of text.
Note - I am not happy with this function as it is in this pull request. I have refactored it into something hopefully easier to understand in the next one.
Fixes #4