Package cannot be loaded in atreplinit
with startup.jl
or on the REPL
#55
Labels
design
There may not be a correct answer
atreplinit
with startup.jl
or on the REPL
#55
So far, the standard way to load
VimBindings.jl
has been to do the following.$ julia -i -e "using VimBindings"
One reason for this is that the package overwrites a large amount of REPL code, and since the REPL is initialized and then
atreplinit()
is called, any code overwritten is simply discarded since the world age of theVimBindings.jl
code is younger than the REPL code running in a loop. More details hereThis is also why a REPL user cannot simply call
using VimBindings
from within the REPL to "gain" new behavior.In the course of writing this issue, I discovered that
VimBindings
can in fact be loaded fromstartup.jl
—only it must be loaded outside ofatreplinit
, for example:Looking at client.jl in julia/base, it becomes clear why this is the case: REPL code is loaded, and immediately
atreplinit
is called (as the name suggests). Thus, trying to initializeVimBindings
from withinatreplinit
won't affect any REPL code, because it's already been initialized.It is blindingly obvious in hindsight that REPL code can be overwritten and modified before a call to
atreplinit
! But it is what it is.Still, it may be able to be improved. The best approach would be one which can simply take the
repl
object and modify the object itself, rather than overwriting any stdlib code at all.The text was updated successfully, but these errors were encountered: