diff --git a/src/core/editor/Modify.re b/src/core/editor/Modify.re index d501b4c0..b2aa3b30 100644 --- a/src/core/editor/Modify.re +++ b/src/core/editor/Modify.re @@ -123,7 +123,7 @@ let mold = // P.show("tok", Token.show(tok)); // P.show("grouted", Grouted.show(grouted)); // P.show("stack", Stack.show(l)); - let connected = Stack.connect(tok, grouted, l); + let connected = Stack.connect(Effects.insert(tok), grouted, l); // P.show("connected", Stack.show(connected)); connected.bound == l.bound ? Ctx.link_stacks((connected, r), rest) diff --git a/src/core/parser/Molder.re b/src/core/parser/Molder.re index a8174e87..1a3c2447 100644 --- a/src/core/parser/Molder.re +++ b/src/core/parser/Molder.re @@ -158,6 +158,7 @@ and remold = // P.show("hd_w", Token.show(hd_w)); switch (mold(~re=true, l, ~fill, Token.unmold(hd_w))) { | Error(fill) => + Effects.remove(hd_w); let (c, up) = unroll_tl_w_hd_cell(); let fill = fill |> Cell.pad(~r=c) |> Cell.mark_ends_dirty; (l, r_tl) |> Stack.Frame.cat(([], up)) |> remold(~fill); @@ -175,7 +176,8 @@ and remold = Error((fill, (connected, r_tl))); }; | Ok((t, grouted, rest)) => - let connected = Stack.connect(t, grouted, rest); + Effects.remove(hd_w); + let connected = Stack.connect(Effects.insert(t), grouted, rest); // check if connection changed the stack bound if (connected.bound == l.bound) { // if not, then nearest bidelimited container is preserved