Julian / lean.nvim

Neovim support for the Lean theorem prover
MIT License
277 stars 26 forks source link

Make calling require'lean'.setup{} idempotent #145

Closed Julian closed 2 years ago

Julian commented 3 years ago

Users occasionally will put this in a file they reload or re-source, so it'd be nice if it were able to be run multiple times.

Right now most of the state issues are simply with initializing global configuration, so this may not be too difficult to do.

(See #132 for some context.)

Relates to #39.

4e554c4c commented 2 years ago

the solution in my config

local success, err = pcall(function ()
  require('lean').setup{}
end)
if not success then
  print(err)
end