diff --git a/CHANGES.md b/CHANGES.md index a1b98ec3db..28f60c0724 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -5,6 +5,7 @@ unreleased - Fix completion not working for inlined records labels (#1978, fixes #1977) - Perform buffer indexing only if the query requires it (#1990 and #1991) - Stop unnecessarily forcing substitutions when initializing short-paths graph (#1988) + - Fix Mocaml.with_printer didn't update replacement_printer_doc (#2010) + test suite - Add a test to ensure the behavior showed in issue #1517 is no longer relevant (#1995) - Add a test to ensure the code fragment exhibited in issue #1118 no longer makes Merlin crash (#1996) diff --git a/src/kernel/mocaml.ml b/src/kernel/mocaml.ml index 0eb6ce4603..e8e83f5012 100644 --- a/src/kernel/mocaml.ml +++ b/src/kernel/mocaml.ml @@ -106,7 +106,9 @@ let default_printer ppf = | Out_type_extension x -> Format_doc.compat default_out_type_extension ppf x | Out_phrase x -> default_out_phrase ppf x -let with_printer printer f = let_ref replacement_printer (Some printer) f +let with_printer printer f = + let_ref replacement_printer (Some printer) @@ fun () -> + let_ref replacement_printer_doc (Some (Format_doc.deprecated printer)) f (* Cleanup caches *) let clear_caches () =