File tree Expand file tree Collapse file tree 1 file changed +12
-1
lines changed
Expand file tree Collapse file tree 1 file changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -987,7 +987,7 @@ def wait_next_action_
987987 result = frame_eval ( eval_src )
988988 when :irb
989989 begin
990- result = frame_eval ( 'binding.irb' , binding_location : true )
990+ result = frame_eval ( binding_irb , binding_location : true )
991991 ensure
992992 # workaround: https://github.com/ruby/debug/issues/308
993993 Reline . prompt_proc = nil if defined? Reline
@@ -1177,6 +1177,17 @@ def wait_next_action_
11771177 raise
11781178 end
11791179
1180+ private def binding_irb
1181+ return @binding_irb if defined? ( @binding_irb )
1182+
1183+ require 'irb' # prelude's binding.irb doesn't have show_code option
1184+ @binding_irb = +'binding.irb'
1185+ if binding . method ( :irb ) . parameters . include? ( [ :key , :show_code ] )
1186+ @binding_irb << '(show_code: false)'
1187+ end
1188+ @binding_irb
1189+ end
1190+
11801191 def debug_event ( ev , args )
11811192 DEBUGGER__ . debug {
11821193 args = args . map { |arg | DEBUGGER__ . safe_inspect ( arg ) }
You can’t perform that action at this time.
0 commit comments