jinh0 / eyeliner.nvim

👀 Move faster with unique f/F indicators.
461 stars 15 forks source link

fix: handle plugin/ being loaded before setup() is called #19

Closed jemag closed 1 year ago

jemag commented 1 year ago

For plugin managers like Lazy.nvim, init.lua and plugin/ will be loaded first, and then setup() will be called. This causes problems currently since enable is already called without the user's configuration.

Will fix https://github.com/jinh0/eyeliner.nvim/issues/15 with cases using above behavior. See https://github.com/folke/lazy.nvim/issues/123#issuecomment-1367773015 for details on the loading order.

This was the simplest change I could think of to handle repeated calls to enable(). If you feel there is a better refactor to be made, feel free to do so.

folke commented 1 year ago

In the meantime I changed the lazy behavior to run config() first, but I'm not 100% sure this is really how it should be. But at least for now the eyeliner plugin should work again, even without this PR

jinh0 commented 1 year ago

Hey @jemag and @folke thank you for your help!

@jemag , I just implemented your fix in the latest commit 7c539e91b6608661162617be2a4be3f454e423cb . I had been working on rewriting the plugin in Fennel so I coded your fix myself in Fennel. Let me know if it works.

jemag commented 1 year ago

works properly with latest commit, thank you for the update