-
Notifications
You must be signed in to change notification settings - Fork 97
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
Refactor and fix multiline text bug #355
Refactor and fix multiline text bug #355
Conversation
@guysalt what is the target of this PR? the mutliline renderer doesn't seem to work? |
oh, I see now. You only added support for to long messages, not messages containing manual linebreaks |
yes... there is too many issues about this problem, and as you can see blessed had all the tools i need to do this. the major challenge was to understanding what's going on there, and tbh there is a lot of mess there. that's why the next pr is mostly about refactor the code. what do you say? are you approving it? |
Yes I know the issues, but it wouod be great if you added some more context to your commits, either in the commit messages or in the PR introducing theme. Its really hard for me to see why you introduced these changes (why is stuff redundant? why did you make a methode static? Etc.). I didn't write the original code and its really hard for me to gage your reasoning and its impact. So please edit either the commit messages or this PRs info. As for the fix: its only a partial fix that only applies to lines longer that Thanks for your hard work on this 👍. You are absolutely right in that its quite the mess. Thats why I never dared to touch it 😅. Defnetly feel free to rework it completly... don't forget tests though |
After i dived in this code, i definitely can add supporting of line containing manual line feed ( Regarding the pull request commits, the code appears to be messy and disorganized, so to be honest i didn't understand what the purpose of some of the lines. Anyway the primary goal of these changes is to modify the logic related to controlling the screen and managing the re-render process. And to accomplish this, i removed any unnecessary code after i changed the logic. i would try now to edit the commit to be more verbal for your CR :) |
a066700
to
63af9ac
Compare
ok so i update the PR first comment to describe each commit reason. i did it instead of editing the commit's messages because i think the commit's messages need just to describe the change and not the reason. also, i edit the commit message from thanks for your time :) |
Note: I beleve the idea of using I believe it would make sense to rework it to only use |
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.
LGTM
great! |
commit 1 - ConsoleRender: remove redundant parameter from _print_status_bar:
commit 2 - ConsoleRender: remove redundant code in _print_header:
print_header
printed every time new line and then move up once. i don't know what the point of working like this. i tried to do some different uses and it's seems to be pretty redundant.commit 3 - ConsoleRender: remove redundant round brackets:
commit 4 - ConsoleRender: remove function _force_initial_column:
_force_initial_column
in the end of the event loop seems to be duplicate as after it we call the_relocate
function who call the_force_initial_column
again._force_initial_column
as it's just print\r
and used once on_relocate_ function. and add in
_relocatefunction print to
\r`.commit 5 - ConsoleRender: adding handling of lines bigger than terminal width:
clear_eos
on start before event loop (as it happens right after).print_str
methodcommit 6 - ConsoleRender: remove redundant terminal.clear_eol from print_line:
commit 7 - ConsoleRender: make render_factory static: