The (currently undocumented) warn
compiler option, used to redirect stderr messages to a custom function is not used when calling compile-string
(and assumedly other compile-*
functions).
Fennels internal warn
function checks root.options
which is nil
, so it always falls back to stderr
.
Reproduction, observe "--WARNING" output written to stderr in the terminal.
(let [{: compile-string} (require :fennel)] (compile-string "(local x\"bad\")" {:warn #(print "warnings are just suggestions")}))
Ah, I think this is what's causing this bug in my Neovim plugin https://github.com/Olical/nfnl/issues/44
The stray stderr output causes Neovim's rendering to go a bit haywire. Will try to work around it for now :)
Should be fixed in cf75dca.