summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-10-12 20:06:43 -0700
committerKaz Kylheku <kaz@kylheku.com>2016-10-12 20:06:43 -0700
commit643e5b1b392509d75f3be732a9a546c54862586d (patch)
tree5853e0a44003d2106fa378354dfd7a22f444a723
parent266020379b40b9624010e35c48f241a3a235b572 (diff)
downloadtxr-643e5b1b392509d75f3be732a9a546c54862586d.tar.gz
txr-643e5b1b392509d75f3be732a9a546c54862586d.tar.bz2
txr-643e5b1b392509d75f3be732a9a546c54862586d.zip
listener: put each result into linenoise.
* parser.c (repl): After each successful command that produces a value, not only print the value but also call lino_set_result to install its string representation into the linenoise object, so it is available for insertion via Ctrl-X Ctrl-P.
-rw-r--r--parser.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/parser.c b/parser.c
index f99db93f..6d7801c8 100644
--- a/parser.c
+++ b/parser.c
@@ -771,6 +771,7 @@ val repl(val bindings, val in_stream, val out_stream)
reg_varl(var_sym, value);
sethash(result_hash, var_counter, value);
prinl(value, out_stream);
+ lino_set_result(ls, utf8_dup_to(c_str(tostring(value))));
lino_hist_add(ls, line_u8);
}
}