Skip to content

Commit

Permalink
Fix CodeEditor option handling (#290)
Browse files Browse the repository at this point in the history
`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.
  • Loading branch information
cstjean authored Mar 3, 2025
1 parent 9475b5d commit 134c608
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/widgets.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit 134c608

Please sign in to comment.