When opening nvim in a directory that does not contain a .envrc file,
this would throw an error on startup.
This is because `vim.json.decode` translates the json null to `vim.NIL`,
which does not match Lua's `nil`
I should have worked more with atomic commits and less with whatever the
hell this is supposed to be, but hindsight is 20/20. tl;dr is that this
refactor improves the plugin with better UX, slightly better
performance, and better compatibility with Neovim 0.10, which I have
overlooked last time. Changes are, from memory, as follows:
- Caching system to prevent excessive direnv status checks
- Statusline integration to show direnv status in real-time
- Proper async handling for all operations
- Added (subpar) .envrc file editor with creation prompt
- Added autocmd hooks for other plugins (User `DirenvLoaded`, fixes#5)
- Better, comprehensive notification system with proper scheduling
- Intuitive handling of allowed/pending/blocked states
- Added command to check direnv status
- Improved contextual commands and keyboard mappings (despite "best"
practices)
For those who have direnv.nvim already set up (despite the repo being
archived for months), I tried to retain full backwards compat. New
functionality and error fixes were built on top.