Skip to content

Commit db41803

Browse files
author
matz
committed
debug.rb - readline fixed
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_3@506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
1 parent 34fc61f commit db41803

File tree

1 file changed

+7
-9
lines changed

1 file changed

+7
-9
lines changed

lib/debug.rb

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
class DEBUGGER__
22
begin
33
require 'readline'
4-
def readline(prompt)
5-
Readline::readline(prompt, true)
4+
def readline(prompt, hist)
5+
Readline::readline(prompt, hist)
66
end
77
rescue LoadError
8-
def readline(prompt)
8+
def readline(prompt, hist)
99
STDOUT.print prompt
1010
STDOUT.flush
1111
line = STDIN.gets
@@ -60,7 +60,7 @@ def debug_command(file, line, id, binding)
6060
end
6161
@frames[0] = binding
6262
display_expressions(binding)
63-
while input = readline("(rdb:-) ")
63+
while input = readline("(rdb:-) ", true)
6464
if input == ""
6565
input = DEBUG_LAST_CMD[0]
6666
else
@@ -112,9 +112,7 @@ def debug_command(file, line, id, binding)
112112
when /^del(?:ete)?(?:\s+(\d+))?$/
113113
pos = $1
114114
unless pos
115-
STDOUT.print "clear all breakpoints? (y/n) "
116-
STDOUT.flush
117-
input = readline
115+
input = readline("clear all breakpoints? (y/n) ", false)
118116
if input == "y"
119117
for b in @break_points
120118
b[0] = false
@@ -141,7 +139,7 @@ def debug_command(file, line, id, binding)
141139
when /^undisp(?:lay)?(?:\s+(\d+))?$/
142140
pos = $1
143141
unless pos
144-
input = readline("clear all expressions? (y/n) ")
142+
input = readline("clear all expressions? (y/n) ", false)
145143
if input == "y"
146144
for d in @display
147145
d[0] = false
@@ -261,7 +259,7 @@ def debug_command(file, line, id, binding)
261259
return
262260

263261
when /^q(?:uit)?$/
264-
input = readline("really quit? (y/n) ")
262+
input = readline("really quit? (y/n) ", false)
265263
exit if input == "y"
266264

267265
when /^p\s+/

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy