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

Remove workaround for empty lines in dynamic_prompt #884

Merged
merged 1 commit into from
Feb 23, 2024

Conversation

tompng
Copy link
Member

@tompng tompng commented Feb 23, 2024

This guard clause looks like a workaround of Reline's bug. I think this bug is already fixed or perhaps never existed.

@context.io.dynamic_prompt do |lines|
  lines << '' if lines.empty?
  ...
end

Also, modifying given value (might be Reline's internal value) is not good. Fortunately, this code is never executed.

Reline calls prompt proc with check_multiline_prompt(whole_buffer) or check_multiline_prompt(@buffer_of_lines)
@buffer_of_lines is always non-empty because Reline would crash when it becomes empty.

@st0012 st0012 merged commit 820b9e8 into ruby:master Feb 23, 2024
29 checks passed
@tompng tompng deleted the remove_reline_empty_lines_workaround branch February 23, 2024 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants