Skip to content

Commit

Permalink
Prevented caret scrolling for all editing modes and prevented caret s…
Browse files Browse the repository at this point in the history
…crolling when moving the caret with arrows
  • Loading branch information
facundoy committed Nov 25, 2024
1 parent 95a7593 commit 0b040a5
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/haz3lweb/Main.re
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,19 @@ let apply = (model, action, ~schedule_action): Model.t => {

let get_settings = (model: Model.t): Settings.t => model.settings;

switch (action, get_settings(model).editing_title) {
let settings = get_settings(model);
let editing_mode =
settings.editing_prompt
|| settings.editing_title
|| settings.editing_test_val_rep
|| settings.editing_mut_test_rep
|| settings.editing_impl_grd_rep
|| settings.editing_module_name;

switch (action, editing_mode) {
| (UpdateAction.PerformAction(Insert(_)), true) => model
| (UpdateAction.PerformAction(Destruct(_)), true) => model
| (UpdateAction.PerformAction(Move(_)), true) => model
| (action, _) =>
if (UpdateAction.is_edit(action)) {
last_edit_action := JsUtil.timestamp();
Expand Down

0 comments on commit 0b040a5

Please sign in to comment.