Skip to content

Instantly share code, notes, and snippets.

@amatsuda
Created June 7, 2021 16:07
Show Gist options
  • Save amatsuda/1d963fa3af40fbef8f15824cb4b25952 to your computer and use it in GitHub Desktop.
Save amatsuda/1d963fa3af40fbef8f15824cb4b25952 to your computer and use it in GitHub Desktop.
diff --git a/lib/reline.rb b/lib/reline.rb
index a7bd4d9..61001f9 100644
--- a/lib/reline.rb
+++ b/lib/reline.rb
@@ -168,10 +168,12 @@ module Reline
Reline::IOGate.get_screen_size
end
- def readmultiline(prompt = '', add_hist = false, &confirm_multiline_termination)
+ def readmultiline(prompt_ = '', add_hist_ = false, prompt: '', use_history: false, &confirm_multiline_termination)
unless confirm_multiline_termination
raise ArgumentError.new('#readmultiline needs block to confirm multiline termination')
end
+ prompt = prompt_ if prompt == ''
+ add_hist = use_history == false ? add_hist_ : use_history
inner_readline(prompt, add_hist, true, &confirm_multiline_termination)
whole_buffer = line_editor.whole_buffer.dup
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment