Skip to content

Commit

Permalink
debug.rb - readline fixed
Browse files Browse the repository at this point in the history
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
matz committed Jul 30, 1999
1 parent 34fc61f commit db41803
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions 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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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+/
Expand Down

0 comments on commit db41803

Please sign in to comment.