Skip to content

Commit 0245e2e

Browse files
committed
REPL: add hascolor & extra_repl_keymap to Options
1 parent b9ba7c4 commit 0245e2e

File tree

1 file changed

+11
-5
lines changed

1 file changed

+11
-5
lines changed

base/repl/REPL.jl

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -241,15 +241,20 @@ function run_frontend(repl::BasicREPL, backend::REPLBackendRef)
241241
dopushdisplay && popdisplay(d)
242242
end
243243

244-
## Custom Options
244+
## User Options
245245

246246
mutable struct Options
247+
hascolor::Bool
248+
extra_keymap::Union{Dict,Vector{<:Dict}}
247249
backspace_align::Bool
248250
backspace_adjust::Bool
249251
end
250252

251-
Options(; backspace_align=true, backspace_adjust=backspace_align) =
252-
Options(backspace_align, backspace_adjust)
253+
Options(;
254+
hascolor = true,
255+
extra_keymap = AnyDict[],
256+
backspace_align = true, backspace_adjust = backspace_align) =
257+
Options(hascolor, extra_keymap, backspace_align, backspace_adjust)
253258

254259
## LineEditREPL ##
255260

@@ -714,8 +719,9 @@ enable_promptpaste(v::Bool) = JL_PROMPT_PASTE[] = v
714719

715720
function setup_interface(
716721
repl::LineEditREPL;
717-
hascolor::Bool = repl.hascolor,
718-
extra_repl_keymap::Union{Dict,Vector{<:Dict}} = Dict{Any,Any}[]
722+
# those keyword arguments may be deprecated eventually in favor of the Options mechanism
723+
hascolor::Bool = repl.options.hascolor,
724+
extra_repl_keymap::Union{Dict,Vector{<:Dict}} = repl.options.extra_keymap
719725
)
720726
###
721727
#

0 commit comments

Comments
 (0)