Skip to content

Conversation

tompng
Copy link
Member

@tompng tompng commented Jul 24, 2024

def render_differential contains both LineEditor's rendering logic and Algorithm part of differential rendering.

This pull request splits them into def render and def render_differential

def render
  LineEditor specific rendering logic part
  construct lines to be rendered to the screen from prompt, input and dialogs
  render_differential(new_lines, new_cursor_x, new_cursor_y)
end

def render_differential(lines, cursor_x, cursor_y)
  pure alogithm part of differential rendering
  independent from promt, input and dialogs
end

Now, render_differential([], 0, 0) can be reused from other method in LineEditor to clear the screen. def clear_rendered_lines is not needed anymore.

Copy link
Member

@ima1zumi ima1zumi left a comment

Choose a reason for hiding this comment

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

LGTM!

@ima1zumi ima1zumi merged commit c90f08f into ruby:master Sep 4, 2024
matzbot pushed a commit to ruby/ruby that referenced this pull request Sep 4, 2024
@tompng tompng deleted the refactor_rendering_method branch September 4, 2024 12:28
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.

2 participants