Skip to content

Commit

Permalink
Fixed problems with attempting to place caret on recently deleted edi…
Browse files Browse the repository at this point in the history
…tor following title-editor branch
  • Loading branch information
facundoy committed Nov 25, 2024
1 parent 0b040a5 commit 9e7900d
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 12 deletions.
7 changes: 3 additions & 4 deletions src/haz3lschool/Exercise.re
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ module F = (ExerciseEnv: ExerciseEnv) => {
tests: editor,
provided: new_prov_test,
},
} /* Set 'provided' to 1 if editing_test_val_rep is true */
},
}
: {
...state,
Expand Down Expand Up @@ -573,11 +573,10 @@ module F = (ExerciseEnv: ExerciseEnv) => {
index < length - 1 ? index + 1 : index - 1,
).
impl
: state.eds.your_tests.tests;
: state.eds.your_impl;
let pos =
length > 1
? HiddenBugs(index < length - 1 ? index : index - 1)
: YourTestsValidation;
? HiddenBugs(index < length - 1 ? index : index - 1) : YourImpl;
let new_state = {
pos,
eds: {
Expand Down
6 changes: 0 additions & 6 deletions src/haz3lweb/Main.re
Original file line number Diff line number Diff line change
Expand Up @@ -42,14 +42,8 @@ let apply = (model, action, ~schedule_action): Model.t => {
last_edit_action := JsUtil.timestamp();
edit_action_applied := true;
};
let old_scroll = scroll_to_caret.contents;
if (Update.should_scroll_to_caret(action)) {
scroll_to_caret := true;
Printf.printf(
"DEBUG: Scroll set to true for action: %s (was: %b)\n",
UpdateAction.show(action),
old_scroll,
);
};
last_edit_action := JsUtil.timestamp();
switch (
Expand Down
1 change: 0 additions & 1 deletion src/haz3lweb/Main.rei

This file was deleted.

9 changes: 8 additions & 1 deletion src/haz3lweb/view/Cell.re
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,14 @@ let wrong_impl_caption = (~inject, sub: string, n: int) => {
[
caption("", ~rest=sub),
div(
~attrs=[Attr.class_("instructor-edit-icon")],
~attrs=[
Attr.class_("instructor-edit-icon"),
Attr.on_mousedown(_ =>
Virtual_dom.Vdom.Effect.(
Many([Prevent_default, Stop_propagation])
)
),
],
[
Widgets.button(
Icons.delete,
Expand Down

0 comments on commit 9e7900d

Please sign in to comment.