Skip to content
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

fix: some off by one bugs with line scrolling and some cleanup #151

Merged
merged 2 commits into from
Nov 25, 2020

Conversation

JFreegman
Copy link
Member

@JFreegman JFreegman commented Nov 23, 2020

Instead of trying (and failing) to correctly calculate the number of lines on the screen a given message will need space for, we dynamically set the value both on initiation of a new line, and whenever that line is printed to the screen using the print_wrap() function.

This should fix the screen occasionally not scrolling down the correct number of lines when a new message is printed.

Edit: Also fixed an issue with the line format breaking if a line contained newlines or no spaces


This change is Reviewable

@JFreegman JFreegman added bug Bug fix for the user, not a fix to a build script cleanup Internal code cleanup, possibly affecting semantics, e.g. deleting a deprecated feature. labels Nov 23, 2020
@JFreegman JFreegman added this to the 0.9.x milestone Nov 23, 2020
@JFreegman JFreegman changed the title Fix some off by one bugs with line scrolling and some cleanup fix: some off by one bugs with line scrolling and some cleanup Nov 23, 2020
@ghost
Copy link

ghost commented Nov 24, 2020

Congratulations 🎉. DeepCode analyzed your code in 4317.305 seconds and we found no issues. Enjoy a moment of no bugs ☀️.

👉 View analysis in DeepCode’s Dashboard | Configure the bot

@JFreegman JFreegman force-pushed the scroll_fix branch 5 times, most recently from 5a67660 to d6f4ffc Compare November 24, 2020 22:22
Instead of trying (and failing) to correctly calculate the number of lines on the
screen a given message will need space for, we dynamically set the value both
on initiation of a new line, and whenever that line is printed to the screen
using the print_wrap() function.

This should fix the screen occasionally not scrolling down the correct number of
lines when a new message is printed.
It should now parse messages with newlines properly as well as messages that
contain long sequences of characters with no spaces
@JFreegman JFreegman merged commit d35a387 into TokTok:master Nov 25, 2020
@JFreegman JFreegman deleted the scroll_fix branch November 25, 2020 00:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug fix for the user, not a fix to a build script cleanup Internal code cleanup, possibly affecting semantics, e.g. deleting a deprecated feature.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants