From 560f0117693b17f495f651ed40fa83d15d7dae16 Mon Sep 17 00:00:00 2001 From: David Moon Date: Mon, 4 Nov 2024 13:40:56 -0500 Subject: [PATCH] fix zigg roll bug not accounting for multi-char tokens --- src/core/editor/Zigg.re | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/editor/Zigg.re b/src/core/editor/Zigg.re index 02119429..5baa196d 100644 --- a/src/core/editor/Zigg.re +++ b/src/core/editor/Zigg.re @@ -186,6 +186,7 @@ let roll_bounds = (~l=Delim.root, ~r=Delim.root, zigg: Base.t(_)) => { let l = switch (l) { | Root => (List.length(zigg.up), Rel.Neq(Dir.L)) + | Node(tok) when Token.merges(tok, face(~side=L, zigg)) => (0, Rel.Eq()) | Node(tok) => switch (push(~side=L, tok, zigg)) { | Error(_) => (List.length(zigg.up), Rel.Neq(L)) @@ -203,6 +204,7 @@ let roll_bounds = (~l=Delim.root, ~r=Delim.root, zigg: Base.t(_)) => { let r = switch (r) { | Root => (List.length(zigg.dn), Rel.Neq(Dir.R)) + | Node(tok) when Token.merges(tok, face(~side=R, zigg)) => (0, Rel.Eq()) | Node(tok) => switch (push(~side=R, tok, zigg)) { | Error(_) => (List.length(zigg.dn), Rel.Neq(R))