diff options
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | lib/rdoc/ri/ri_display.rb | 17 |
2 files changed, 13 insertions, 9 deletions
@@ -1,3 +1,8 @@ +Wed Mar 3 18:58:20 2004 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * lib/rdoc/ri/ri_display.rb (DefaultDisplay::setup_pager): ensure + pager closes and stdout is restored. + Wed Mar 3 13:10:56 2004 Yukihiro Matsumoto <matz@ruby-lang.org> * eval.c (method_hash): new method. [ruby-talk:93968] diff --git a/lib/rdoc/ri/ri_display.rb b/lib/rdoc/ri/ri_display.rb index 500632ae05..d07f595531 100644 --- a/lib/rdoc/ri/ri_display.rb +++ b/lib/rdoc/ri/ri_display.rb @@ -183,12 +183,11 @@ class DefaultDisplay ###################################################################### def page - setup_pager + pager = setup_pager begin yield - page_output ensure - STDOUT.reopen(@save_stdout) if @save_stdout + page_output(pager) end end @@ -203,20 +202,20 @@ class DefaultDisplay else @save_stdout = STDOUT.clone STDOUT.reopen(pager) - return + return pager end end @options.use_stdout = true + nil end end ###################################################################### - def page_output - unless @options.use_stdout - STDOUT.reopen(@save_stdout) - @save_stdout = nil - end + def page_output(pager) + STDOUT.reopen(@save_stdout) if @save_stdout + @save_stdout = nil + pager.close if pager end ###################################################################### |