Skip to content

Commit 46b8ea0

Browse files
committed
Add Session#deactivate_irb_integration
1 parent 04c807f commit 46b8ea0

File tree

2 files changed

+11
-5
lines changed

2 files changed

+11
-5
lines changed

lib/debug/config.rb

+1-5
Original file line numberDiff line numberDiff line change
@@ -163,11 +163,7 @@ def update conf
163163
if defined?(SESSION) && SESSION.active?
164164
# irb_console is switched from true to false
165165
if old
166-
Reline.completion_proc = nil
167-
Reline.output_modifier_proc = nil
168-
Reline.autocompletion = false
169-
Reline.dig_perfect_match_proc = nil
170-
SESSION.reset_ui UI_LocalConsole.new
166+
SESSION.deactivate_irb_integration
171167
# irb_console is switched from false to true
172168
else
173169
if CONFIG[:open]

lib/debug/irb_integration.rb

+10
Original file line numberDiff line numberDiff line change
@@ -24,4 +24,14 @@ def activate_irb_integration
2424
IRB::Context.prepend(IrbPatch)
2525
end
2626
end
27+
28+
class Session
29+
def deactivate_irb_integration
30+
Reline.completion_proc = nil
31+
Reline.output_modifier_proc = nil
32+
Reline.autocompletion = false
33+
Reline.dig_perfect_match_proc = nil
34+
reset_ui UI_LocalConsole.new
35+
end
36+
end
2737
end

0 commit comments

Comments
 (0)