ReplMaker.jl
ReplMaker.jl copied to clipboard
Fix startup script example in README.md
The example startup script was not legal Julia code, this is my suggested fix
After testing this on Julia 1.8.5 I found that it also does not work as it throws a MethodError
. The best solution that I could find that actually works is:
import ReplMaker
atreplinit() do repl
try
@async try
ReplMaker.initrepl(
apropos;
prompt_text="search> ",
prompt_color=:magenta,
start_key=')',
mode_name="search_mode"
)
catch e1
@warn e1
end
catch e2
@warn e2
end
end
Is @async
really necessary? I found that it worked fine with just the following startup.jl:
import ReplMaker
atreplinit() do repl
try
ReplMaker.initrepl(
apropos;
prompt_text="search> ",
prompt_color=:magenta,
start_key=')',
mode_name="search_mode"
)
catch e1
@warn e1
end
end
Oops, thanks. The @async
block is not necessary, but nice because it can get you into the REPL quicker if the startup takes a while.