HISTORY pushes the history on the stack as a list
This commit is contained in:
parent
0d07d0e0dd
commit
d54bebdcec
1 changed files with 2 additions and 4 deletions
6
bin/rpl
6
bin/rpl
|
@ -46,12 +46,10 @@ class RplRepl
|
|||
if input.strip == 'edit'
|
||||
prefill = @interpreter.stack.pop.to_s
|
||||
elsif input.strip == 'history'
|
||||
Readline::HISTORY.each do |line|
|
||||
pp line
|
||||
end
|
||||
@interpreter.run( "{ #{Reline::HISTORY.map { |line| "\"#{line}\"" }.join(' ')} }" )
|
||||
elsif input.empty?
|
||||
# Remove blank lines from history
|
||||
Readline::HISTORY.pop
|
||||
Reline::HISTORY.pop
|
||||
else
|
||||
begin
|
||||
@interpreter.run( input )
|
||||
|
|
Loading…
Reference in a new issue