File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change 1
1
(* This file is part of Learn-OCaml.
2
2
*
3
- * Copyright (C) 2019-2020 OCaml Software Foundation.
3
+ * Copyright (C) 2019-2022 OCaml Software Foundation.
4
4
* Copyright (C) 2016-2018 OCamlPro.
5
5
*
6
6
* Learn-OCaml is distributed under the terms of the MIT license. See the
@@ -976,7 +976,10 @@ module Editor_button (E : Editor_info) = struct
976
976
sync_exercise token id ~editor: (Ace. get_contents E. ace) on_sync
977
977
> |= fun _save -> () );
978
978
Ace. register_sync_observer E. ace (fun sync ->
979
- if sync then disable_button state else enable_button state)
979
+ (* this is run twice when clicking on Reset, because of Ace's implem *)
980
+ if sync then disable_button state else enable_button state);
981
+ (* Disable the Sync button at loading time: *)
982
+ Ace. set_synchronized E. ace
980
983
981
984
end
982
985
@@ -989,6 +992,7 @@ let setup_editor id solution =
989
992
in
990
993
let ace = Ocaml_mode. get_editor editor in
991
994
Ace. set_contents ace ~reset_undo: true solution;
995
+ (* "Ace.set_synchronized ace" done after "Ace.register_sync_observer" above *)
992
996
Ace. set_font_size ace 18 ;
993
997
editor, ace
994
998
You can’t perform that action at this time.
0 commit comments