diff options
author | aycabta <[email protected]> | 2019-06-14 08:26:06 +0900 |
---|---|---|
committer | aycabta <[email protected]> | 2019-06-14 08:26:06 +0900 |
commit | f80771f0a989efdde2276d4d6d213cb096843e92 (patch) | |
tree | bf929fc702b512cc48aa9bd168f45433d8b090c9 /lib/irb/input-method.rb | |
parent | 3757e492fb815656341dd430465e0f069e1bd562 (diff) |
Use Reline.prompt_proc in IRB
Diffstat (limited to 'lib/irb/input-method.rb')
-rw-r--r-- | lib/irb/input-method.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/irb/input-method.rb b/lib/irb/input-method.rb index aa62a628c8..68d2ad280c 100644 --- a/lib/irb/input-method.rb +++ b/lib/irb/input-method.rb @@ -240,12 +240,17 @@ module IRB @check_termination_proc = block end + def dynamic_prompt(&block) + @prompt_proc = block + end + # Reads the next line from this input method. # # See IO#gets for more information. def gets Reline.input = @stdin Reline.output = @stdout + Reline.prompt_proc = @prompt_proc if l = readmultiline(@prompt, false, &@check_termination_proc) HISTORY.push(l) if !l.empty? @line[@line_no += 1] = l + "\n" |