Skip to content

Commit

Permalink
Merge pull request #74 from AlexisHamon/main
Browse files Browse the repository at this point in the history
🐛 fix error highlight location of js execute_callback
  • Loading branch information
jbdoderlein authored Mar 21, 2024
2 parents 33e8974 + 2c6f39e commit ee4286f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion toplevel_build/toplevel.ml
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,8 @@ let sanitize_command cmd =
else cmd

let execute_callback mode content =
let output = by_id "output" in
current_position := output##.childNodes##.length;
let content' = sanitize_command content in
match mode with
|"internal" -> JsooTop.execute true ~pp_code:binsharp_ppf ~highlight_location bincaml_ppf content'
Expand All @@ -369,7 +371,6 @@ let run _ =
let textbox : 'a Js.t = by_id_coerce "userinput" Dom_html.CoerceTo.textarea in
let execute () =
let content = Js.to_string textbox##.value##trim in
current_position := output##.childNodes##.length;
History.push content;
textbox##.value := Js.string "";
execute_callback "toplevel" content;
Expand Down

0 comments on commit ee4286f

Please sign in to comment.