Skip to content

Commit

Permalink
Add Session#deactivate_irb_integration
Browse files Browse the repository at this point in the history
  • Loading branch information
st0012 authored and ko1 committed Feb 21, 2024
1 parent 935f903 commit 68f7753
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 5 deletions.
6 changes: 1 addition & 5 deletions lib/debug/config.rb
Original file line number Diff line number Diff line change
Expand Up @@ -163,11 +163,7 @@ def update conf
if defined?(SESSION) && SESSION.active?
# irb_console is switched from true to false
if old
Reline.completion_proc = nil
Reline.output_modifier_proc = nil
Reline.autocompletion = false
Reline.dig_perfect_match_proc = nil
SESSION.reset_ui UI_LocalConsole.new
SESSION.deactivate_irb_integration
# irb_console is switched from false to true
else
if CONFIG[:open]
Expand Down
10 changes: 10 additions & 0 deletions lib/debug/irb_integration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,4 +24,14 @@ def activate_irb_integration
IRB::Context.prepend(IrbPatch)
end
end

class Session
def deactivate_irb_integration
Reline.completion_proc = nil
Reline.output_modifier_proc = nil
Reline.autocompletion = false
Reline.dig_perfect_match_proc = nil
reset_ui UI_LocalConsole.new
end
end
end

0 comments on commit 68f7753

Please sign in to comment.