Skip to content

Commit

Permalink
Stop stepper reset when updating settings
Browse files Browse the repository at this point in the history
  • Loading branch information
Negabinary committed Nov 26, 2024
1 parent 3f72c71 commit 100f8ef
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
12 changes: 0 additions & 12 deletions src/haz3lcore/dynamics/DHExp.re
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,6 @@ let mk = (ids, term): t => {
{ids, copied: true, term};
};

let (replace_all_ids, replace_all_ids_typ) = {
let f:
'a.
(IdTagged.t('a) => IdTagged.t('a), IdTagged.t('a)) => IdTagged.t('a)
=
(continue, exp) => {...exp, ids: [Id.mk()]} |> continue;
(
map_term(~f_exp=f, ~f_pat=f, ~f_typ=f, ~f_tpat=f, ~f_rul=f),
Typ.map_term(~f_exp=f, ~f_pat=f, ~f_typ=f, ~f_tpat=f, ~f_rul=f),
);
};

// TODO: make this function emit a map of changes
let repair_ids =
map_term(
Expand Down
19 changes: 18 additions & 1 deletion src/haz3lweb/view/StepperView.re
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,24 @@ module Update = {
elab: Exp.t,
{history, cached_settings, cached_elab}: Model.t,
) => {
let settings = cached_settings |> Calc.set(settings);
let settings =
cached_settings
|> Calc.set(settings, ~eq=(a, b) => {
CoreSettings.{
...a,
evaluation: {
...a.evaluation,
show_settings: true,
},
}
== CoreSettings.{
...b,
evaluation: {
...b.evaluation,
show_settings: true,
},
}
});
let elab = cached_elab |> Calc.set(~eq=Exp.fast_equal, elab);

let (prev_a, history) =
Expand Down

0 comments on commit 100f8ef

Please sign in to comment.