Skip to content

Commit

Permalink
not sure why this partial revert fixes a grouter failure but it does …
Browse files Browse the repository at this point in the history
…when inserting x in let |<> >=< <> >in< <>
  • Loading branch information
dm0n3y committed Sep 30, 2024
1 parent e5129c9 commit 63d3ee1
Showing 1 changed file with 19 additions and 13 deletions.
32 changes: 19 additions & 13 deletions src/core/structure/Cell.re
Original file line number Diff line number Diff line change
Expand Up @@ -275,22 +275,28 @@ module Space = {
if (!is_space(l) || !is_space(r)) {
raise(Invalid_argument("Cell.Space.merge"));
};
let shift_opt =
l.meld |> Option.map(m => 2 * List.length(Meld.tokens(m)));
let shift = Option.value(shift_opt, ~default=0);
let marks =
r.marks
|> Marks.map_paths(
fun
| [] => {
assert(r.meld == None);
[shift];
}
| [hd, ...tl] => [hd + shift, ...tl],
)
|> (
switch (l.meld) {
| None => Fun.id
| Some(m) =>
let shift = 2 * List.length(Meld.tokens(m));
Marks.map_paths(
fun
| [] => {
assert(r.meld == None);
[shift];
}
| [hd, ...tl] => [hd + shift, ...tl],
);
}
)
|> Marks.union(
switch (shift_opt) {
| Some(n) => Marks.cons(n, fill.marks)
switch (l.meld) {
| Some(m) =>
let n = 2 * List.length(Meld.tokens(m));
Marks.cons(n, fill.marks);
| None => fill.marks
},
)
Expand Down

0 comments on commit 63d3ee1

Please sign in to comment.