Skip to content

Remove workaround for empty lines in dynamic_prompt - #884

Merged
st0012 merged 1 commit into
ruby:masterfrom
tompng:remove_reline_empty_lines_workaround
Feb 23, 2024
Merged

st0012 merged 1 commit into
ruby:masterfrom
tompng:remove_reline_empty_lines_workaround

Conversation

@tompng

@tompng tompng commented Feb 23, 2024

Copy link
Copy Markdown
Member

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
@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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants