From d54bebdcec8a3bb26a00a14e44536f21c012a23c Mon Sep 17 00:00:00 2001 From: Gwenhael Le Moine Date: Tue, 11 Oct 2022 13:32:19 +0200 Subject: [PATCH] HISTORY pushes the history on the stack as a list --- bin/rpl | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/bin/rpl b/bin/rpl index adb9746..f1c08b2 100755 --- a/bin/rpl +++ b/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 )