Skip to content

Commit

Permalink
fix zigg roll bug not accounting for multi-char tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
dm0n3y committed Nov 4, 2024
1 parent 624d657 commit 560f011
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/core/editor/Zigg.re
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand All @@ -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))
Expand Down

0 comments on commit 560f011

Please sign in to comment.