From 134c608ae91db25307704ef5dba78692caf1a787 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20St-Jean?= Date: Tue, 4 Mar 2025 02:01:39 +0900 Subject: [PATCH] Fix CodeEditor option handling (#290) `merge` works so that the entries from the second dictionary have precedence. The way it's written right now, user options are overwritten by `defaults` (and thus ignored) ```julia julia> merge(Dict(1=>2), Dict(1=>4)) Dict{Int64, Int64} with 1 entry: 1 => 4 ``` This commit fixes that. --- src/widgets.jl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/widgets.jl b/src/widgets.jl index 8734a078..e91681e3 100644 --- a/src/widgets.jl +++ b/src/widgets.jl @@ -479,7 +479,7 @@ function CodeEditor( "showPrintMargin" => false, ) user_opts = Dict{String,Any}(string(k) => v for (k, v) in editor_options) - options = Dict{String,Any}(merge(user_opts, defaults)) + options = Dict{String,Any}(merge(defaults, user_opts)) onchange = Observable(initial_source) style = Styles(style, "position" => "relative",