Closed bangedorrunt closed 2 years ago
Hmm, it's weird, now I have the same issue with impatient.nvim
plugin already removed. The macro command!
mentioned above still apply in this case.
Possibly caused by latest fennel
update? afaik, hotpot
hasn't updated to latest fennel
yet.
Hmm there could be issues, Fennel is changing a LOT right now as they move towards v1, so they're making breaking changes in the run up. I think I've insulated you from the environment changes with Aniseed though.
They did change some actual compiler things too, the one that comes to mind is (when ...)
used to produce a single branch if that would return absolutely nothing (not even nil
) in the else
case because Lua lets you do that (in the same way it lets you return many values from one function). Now (when ...)
returns a two branch if
and the else
contains return nil
basically, so you always get a value, even if it's nil.
I prefer that and I think it's the right move, but it could be a breaking change if you're expecting absolutely nothing returned from some functions in some cases.
Hmm, interesting, this could be the case then. https://github.com/bakpakin/Fennel/commit/176c90b0695a5e3880b2fc856d6a445119a7e7ee
Update: I use built-in nvim.ex.command
for the command
macro (instead of vim.cmd
) and the issue is resolved. There actually must be something weird with macros evaluation since your rewritten.
(fn command [name expr]
(if (fn? expr)
`(nvim.ex.command_ ,(->str name) :call ,(vlua expr))
`(nvim.ex.command_ ,(->str name) ,expr)))
(fn buf-command [name expr]
(if (fn? expr)
`(nvim.ex.command_ :-buffer ,(->str name) :call ,(vlua expr))
`(nvim.ex.command_ :-buffer ,(->str name) ,expr)))
How's this look on develop for you now, out of interest? I've added some extra options and defaults to force the module macros to produce static ready Lua even if you're compiling in a dynamic env or where the module already exists.
I used to assume if the module is already loaded and you try to compile it you're doing an interactive eval, so it produced dynamic eval targeted Lua. Now I force it to produce static ready Lua in more scenarios.
It's working for me and shaved off about 20-50ms! That plus Aniseed's new module system which produces MUCH more efficient and minimal Lua now. (in line with what you'd hand write anyway)
@Olical first of all, kudos to your hardworking. When I saw what you said above, I couldn't wait to try it out. I'm happy to say that my issue is fixed, though it might be too soon to speak. Also, it feels snappier when startup. You're genius 🧙♂️
@Olical
This is the reason why my autocmd
called multiple times. Now we can safely put this issue at ease
https://github.com/wbthomason/packer.nvim/pull/636
Using
impatient.nvim
give me significant startup improvement, however this also give me a weird and/or unknow bug as shown in the followinghttps://user-images.githubusercontent.com/1514823/134770663-9710587e-3bce-4f52-aa66-99be73d37b0b.mov
Actual behavior: a same file was loaded 4 times
Expected behavior: file is loaded normally
The config which caused the issue
Remove
impatient.nvim
plugin, the configuration works as normalQuote from Aniseed creator: