mirror of
https://github.com/pry/pry.git
synced 2022-11-09 12:35:05 -05:00
first attempt at history replay working
This commit is contained in:
parent
c41e18191b
commit
33d4cb26db
1 changed files with 9 additions and 3 deletions
|
@ -27,9 +27,15 @@ class Pry
|
|||
command ".<shell command>", "All text following a '.' is forwarded to the shell." do
|
||||
end
|
||||
|
||||
command "hist", "Show Readline history" do
|
||||
text = add_line_numbers(Readline::HISTORY.to_a.join("\n"), 0)
|
||||
stagger_output(text)
|
||||
command "hist", "Show Readline history" do |start_line, end_line|
|
||||
if !start_line
|
||||
text = add_line_numbers(Readline::HISTORY.to_a.join("\n"), 0)
|
||||
stagger_output(text)
|
||||
next
|
||||
end
|
||||
|
||||
actions = Readline::HISTORY.to_a[start_line.to_i..end_line.to_i].join("\n") + "\n_pry_.input=Readline\n"
|
||||
Pry.active_instance.input = StringIO.new(actions)
|
||||
end
|
||||
|
||||
command "exit-program", "End the current program. Aliases: quit-program, !!!" do
|
||||
|
|
Loading…
Reference in a new issue