diff options
author | aycabta <aycabta@gmail.com> | 2019-05-21 01:18:19 +0900 |
---|---|---|
committer | aycabta <aycabta@gmail.com> | 2019-05-21 01:50:07 +0900 |
commit | 34d7ec4e9b0a24b3ce89009927738f1dac38e6d3 (patch) | |
tree | fa77722b4a885d027704ab373b12aaf34f6e1b52 /lib | |
parent | b69dfdb4b3d9dfce18123d1814087fc49b390ea9 (diff) | |
download | ruby-34d7ec4e9b0a24b3ce89009927738f1dac38e6d3.tar.gz |
Finish only when buffer contains non-blank line
Diffstat (limited to 'lib')
-rw-r--r-- | lib/reline/line_editor.rb | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/reline/line_editor.rb b/lib/reline/line_editor.rb index a1541956ea..a611a4d4f0 100644 --- a/lib/reline/line_editor.rb +++ b/lib/reline/line_editor.rb @@ -659,7 +659,9 @@ class Reline::LineEditor if @previous_line_index and @line_index == (@buffer_of_lines.size - 1) temp_buffer[@previous_line_index] = @line end - finish if @confirm_multiline_termination_proc.(temp_buffer.join("\n")) + if temp_buffer.any?{ |l| l.chomp != '' } + finish if @confirm_multiline_termination_proc.(temp_buffer.join("\n")) + end end end |