Compare commits

...

2 commits

Author SHA1 Message Date
raf
a2f1264909
Merge pull request #8 from ergotu/fix-missing-envrc
Some checks failed
Style & Lint / lint (5.1) (push) Has been cancelled
Style & Lint / style (0.19.1) (push) Has been cancelled
fix: check if status.state.foundRC equals vim.NIL
2025-04-23 15:02:48 +00:00
Jordi Lambrechts
57a8fcdf29 fix: check if status.state.foundRC equals vim.NIL
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`
2025-04-23 05:39:35 +02:00

View file

@ -142,7 +142,7 @@ M._get_rc_status = function(callback)
return callback(nil, nil)
end
if status.state.foundRC == nil then
if status.state.foundRC == vim.NIL then
cache.status = nil
cache.path = nil
cache.last_check = now