From 7736be0fad0ce7805e7fe90eb12c9689b03d34a2 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Wed, 12 Oct 2016 20:06:43 -0700 Subject: 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. --- parser.c | 1 + 1 file changed, 1 insertion(+) 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); } } -- cgit v1.2.3