Closed gbaptista closed 2 years ago
Today, if you start a REPL through the fennel command, it will add readline support, if available.
fennel
But, if you start the REPL through the public API, e.g.:
fennel -e "(let [f (require :fennel)] (f.repl {}))"
Or try to start a REPL inside some part of your code:
(local fennel (require :fennel)) (fennel.repl {})
The readline support won't be added, even if you have it available.
This PR moves the try-readline function from launcher.fnl to repl.fnl so that both ways add readline support.
try-readline
launcher.fnl
repl.fnl
If the user provides readChunk or registerCompleter, It will not add readline support to avoid interfering with the desired customization.
readChunk
registerCompleter
Also, it removes the requirement of the options parameter when starting a REPL: I found no reason to be something mandatory.
Looks good; thanks!
Today, if you start a REPL through the
fennel
command, it will add readline support, if available.But, if you start the REPL through the public API, e.g.:
Or try to start a REPL inside some part of your code:
The readline support won't be added, even if you have it available.
This PR moves the
try-readline
function fromlauncher.fnl
torepl.fnl
so that both ways add readline support.If the user provides
readChunk
orregisterCompleter
, It will not add readline support to avoid interfering with the desired customization.Also, it removes the requirement of the options parameter when starting a REPL: I found no reason to be something mandatory.