mirror of
https://github.com/peklaiho/madlisp.git
synced 2024-11-22 21:35:03 +00:00
save history also for failed commands in repl
This commit is contained in:
parent
ad2aea9c70
commit
325a1bcaf0
10
run.php
10
run.php
@ -18,11 +18,6 @@ function ml_repl($lisp)
|
||||
|
||||
try {
|
||||
$lisp->rep($input, true);
|
||||
|
||||
if ($input) {
|
||||
readline_add_history($input);
|
||||
readline_write_history($historyFile);
|
||||
}
|
||||
} catch (MadLisp\MadLispException $ex) {
|
||||
print('error: ' . $ex->getMessage());
|
||||
} catch (TypeError $ex) {
|
||||
@ -30,6 +25,11 @@ function ml_repl($lisp)
|
||||
}
|
||||
|
||||
print(PHP_EOL);
|
||||
|
||||
if ($input) {
|
||||
readline_add_history($input);
|
||||
readline_write_history($historyFile);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user