summaryrefslogtreecommitdiffstats
path: root/parser.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2015-10-27 06:27:11 -0700
committerKaz Kylheku <kaz@kylheku.com>2015-10-27 06:27:11 -0700
commit9d02ab722536227d488a31f5d580bc41501a7f68 (patch)
tree39cd8006d8399cbe70ebfa0887a98cbb99707e00 /parser.c
parent9144d264ae9600fca5d38affdda262f7ea46282f (diff)
downloadtxr-9d02ab722536227d488a31f5d580bc41501a7f68.tar.gz
txr-9d02ab722536227d488a31f5d580bc41501a7f68.tar.bz2
txr-9d02ab722536227d488a31f5d580bc41501a7f68.zip
Fix *listener-hist-len* in ~/.txr_profile not working.
On startup, the history is trimmed to 100 lines regardless of the variable's value in the profile file. * parser.c (repl): Load the rc file first, then load the history file. Furthermore, call lino_hist_set_max_len between these operations with the latest value pulled from the *listener-hist-len* variable.
Diffstat (limited to 'parser.c')
-rw-r--r--parser.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/parser.c b/parser.c
index 6caa3a41..5e607fd5 100644
--- a/parser.c
+++ b/parser.c
@@ -640,12 +640,14 @@ val repl(val bindings, val in_stream, val out_stream)
lino_set_atom_cb(ls, provide_atom, 0);
lino_set_tempfile_suffix(ls, ".tl");
- if (histfile)
- lino_hist_load(ls, histfile_u8);
-
if (rcfile)
load_rcfile(rcfile);
+ lino_hist_set_max_len(ls, c_num(cdr(hist_len_var)));
+
+ if (histfile)
+ lino_hist_load(ls, histfile_u8);
+
while (!done) {
val prompt = format(nil, lit("~a> "), counter, nao);
val prev_counter = counter;