From db41803494d15d2bf3fb2da958388f175781b42a Mon Sep 17 00:00:00 2001 From: matz Date: Fri, 30 Jul 1999 06:41:15 +0000 Subject: [PATCH] debug.rb - readline fixed git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/debug.rb | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/lib/debug.rb b/lib/debug.rb index 906a1fb7d3a7c9..78a0ce245e35a3 100644 --- a/lib/debug.rb +++ b/lib/debug.rb @@ -1,11 +1,11 @@ class DEBUGGER__ begin require 'readline' - def readline(prompt) - Readline::readline(prompt, true) + def readline(prompt, hist) + Readline::readline(prompt, hist) end rescue LoadError - def readline(prompt) + def readline(prompt, hist) STDOUT.print prompt STDOUT.flush line = STDIN.gets @@ -60,7 +60,7 @@ def debug_command(file, line, id, binding) end @frames[0] = binding display_expressions(binding) - while input = readline("(rdb:-) ") + while input = readline("(rdb:-) ", true) if input == "" input = DEBUG_LAST_CMD[0] else @@ -112,9 +112,7 @@ def debug_command(file, line, id, binding) when /^del(?:ete)?(?:\s+(\d+))?$/ pos = $1 unless pos - STDOUT.print "clear all breakpoints? (y/n) " - STDOUT.flush - input = readline + input = readline("clear all breakpoints? (y/n) ", false) if input == "y" for b in @break_points b[0] = false @@ -141,7 +139,7 @@ def debug_command(file, line, id, binding) when /^undisp(?:lay)?(?:\s+(\d+))?$/ pos = $1 unless pos - input = readline("clear all expressions? (y/n) ") + input = readline("clear all expressions? (y/n) ", false) if input == "y" for d in @display d[0] = false @@ -261,7 +259,7 @@ def debug_command(file, line, id, binding) return when /^q(?:uit)?$/ - input = readline("really quit? (y/n) ") + input = readline("really quit? (y/n) ", false) exit if input == "y" when /^p\s+/