Julian / lean.nvim

neovim support for the Lean theorem prover
MIT License
255 stars 25 forks source link

Fix crashing when loading lean config #276

Closed 4e554c4c closed 2 years ago

4e554c4c commented 2 years ago

This fixes a crash that occurs when lean is configured outside of a config function from packer. Technically---instead of communicating changes to the filetype configuration through a shared configuration global, the relevant configuration (default filetype) is shared through one single global. Furthermore, if this global is written by the user before the plugin is loaded, then this global will not be managed by the plugin. This allows a user to configure default filetype even if the plugin is not loaded!

Fixes #275

Julian commented 2 years ago

Thanks! Will merge to fix the breakage but if you think of a way we could reproduce this in CI that'd probably be nice. I suspect it may be hard given we're at the mercy of however plenary sequences running files though.