From 3f819e2dfd1354158028163a75c753471a0e22b8 Mon Sep 17 00:00:00 2001 From: Mark Date: Sat, 22 Jul 2023 11:53:09 -0600 Subject: [PATCH] additional write fixes, use rustyline 12.0.0 (#1876, #1901) --- src/heap_print.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/heap_print.rs b/src/heap_print.rs index 3463b0e0..9b0755d9 100644 --- a/src/heap_print.rs +++ b/src/heap_print.rs @@ -1465,6 +1465,12 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> { let print_struct = |printer: &mut Self, name: Atom, arity: usize| { if name == atom!("[]") && arity == 0 { + if let Some(TokenOrRedirect::CloseList(_)) = printer.state_stack.last() { + if printer.at_cdr("") { + return; + } + } + append_str!(printer, "[]"); } else if arity > 0 { if let Some(spec) = fetch_op_spec(name, arity, printer.op_dir) { @@ -1516,7 +1522,7 @@ impl<'a, Outputter: HCValueOutputter> HCPrinter<'a, Outputter> { None => return, }; - if !addr.is_compound(&self.iter.heap) && self.max_depth_exhausted(max_depth) { + if !addr.is_var() && !addr.is_compound(&self.iter.heap) && self.max_depth_exhausted(max_depth) { self.state_stack.push(TokenOrRedirect::Atom(atom!("..."))); return; } -- 2.54.0