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`
This commit is contained in:
Jordi Lambrechts 2025-04-17 08:32:06 +02:00
commit 57a8fcdf29

View file

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