From 889fcfde1d9a3dedaeab3490b73e1ec2b94db4a6 Mon Sep 17 00:00:00 2001 From: Robin Daugherty Date: Sat, 5 Aug 2017 17:15:13 -0400 Subject: [PATCH] Provide pry's command prompt after eval --- lib/better_errors/pry/repl/pry.rb | 4 +++- spec/better_errors/error_page_spec.rb | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/better_errors/pry/repl/pry.rb b/lib/better_errors/pry/repl/pry.rb index 4390ec7..3f1c17d 100644 --- a/lib/better_errors/pry/repl/pry.rb +++ b/lib/better_errors/pry/repl/pry.rb @@ -61,7 +61,9 @@ def send_input(str) end def prompt - if indent = @pry.instance_variable_get(:@indent) and !indent.indent_level.empty? + if @pry.respond_to? :select_prompt + [@pry.select_prompt, ""] + elsif indent = @pry.instance_variable_get(:@indent) and !indent.indent_level.empty? ["..", indent.indent_level] else [">>", ""] diff --git a/spec/better_errors/error_page_spec.rb b/spec/better_errors/error_page_spec.rb index 191b536..3b70e33 100644 --- a/spec/better_errors/error_page_spec.rb +++ b/spec/better_errors/error_page_spec.rb @@ -41,7 +41,7 @@ expect(do_eval).to include( highlighted_input: /stuff_was_done/, prefilled_input: '', - prompt: '>>', + prompt: '[2] pry(#):1> ', result: "=> \"response\"\n", ) end