bf92151
From b24852058fc87c940252c8a711c60ae2eb298082 Mon Sep 17 00:00:00 2001
bf92151
From: Jun Aruga <jaruga@redhat.com>
bf92151
Date: Thu, 25 Aug 2022 20:11:34 +0200
bf92151
Subject: [PATCH] Require RDoc in `input-method.rb` again in a limited scope.
bf92151
bf92151
RDoc is implemented as soft dependency in IRB. See how the rdoc is required in
bf92151
the files. I reverted the commit below.
bf92151
bf92151
```
bf92151
$ grep -ril rdoc lib/
bf92151
lib/irb/cmd/help.rb
bf92151
lib/irb/completion.rb
bf92151
lib/irb/easter-egg.rb
bf92151
lib/irb/input-method.rb
bf92151
```
bf92151
bf92151
---
bf92151
bf92151
Revert "Remove `require` in signal handler to avoid ThreadError"
bf92151
bf92151
This reverts commit 5f749c613c895cf1b11b5e4cbd1205363bc58028.
bf92151
---
bf92151
 lib/irb/input-method.rb | 5 +++++
bf92151
 1 file changed, 5 insertions(+)
bf92151
bf92151
diff --git a/lib/irb/input-method.rb b/lib/irb/input-method.rb
bf92151
index a8227ca..b77fd32 100644
bf92151
--- a/lib/irb/input-method.rb
bf92151
+++ b/lib/irb/input-method.rb
bf92151
@@ -320,6 +320,11 @@ def auto_indent(&block)
bf92151
         [195, 164], # The "ä" that appears when Alt+d is pressed on xterm.
bf92151
         [226, 136, 130] # The "∂" that appears when Alt+d in pressed on iTerm2.
bf92151
       ]
bf92151
+      begin
bf92151
+        require 'rdoc'
bf92151
+      rescue LoadError
bf92151
+        return nil
bf92151
+      end
bf92151
 
bf92151
       if just_cursor_moving and completion_journey_data.nil?
bf92151
         return nil