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

refactor(debugger): use context when drawing #6520

Merged
merged 8 commits into from
Dec 4, 2023
Merged

Conversation

DaniPopes
Copy link
Member

@DaniPopes DaniPopes commented Dec 4, 2023

Motivation

Slowly untangle the draw code. Will require yet another follow-up to clean up the actual implementation to not overload the diff of this PR.

Solution

Implement the draw functions as methods on the context.

@DaniPopes DaniPopes marked this pull request as ready for review December 4, 2023 17:25
Copy link
Member

@mattsse mattsse left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, providing the terminal as input is very readable

Copy link
Member

@Evalir Evalir left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, just saw this dangling todo


/// This is currently used to remember last scroll position so screen doesn't wiggle as much.
#[derive(Default)]
pub(crate) struct DrawMemory {
pub(crate) current_startline: usize,
// TODO
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what's this todo for?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It was the only field that gets modified while drawing, I don't know if removing the mutation breaks the debugger since I have no idea what that code does :D
I'll address in follow-up

@DaniPopes DaniPopes merged commit 677e810 into master Dec 4, 2023
19 checks passed
@DaniPopes DaniPopes deleted the dani/debugger-stuff4 branch December 4, 2023 18:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants