fix(cache): replace stale M._cache field with get_raw_cache accessor

Problem: M._cache = cache_data captured the initial empty table reference
at module load time. After M.load() reassigns cache_data to the decoded
JSON, M._cache is permanently stale and returns the wrong table.

Solution: remove the field assignment and expose get_raw_cache() which
closes over cache_data and always returns the current table.
This commit is contained in:
Barrett Ruth 2026-02-26 22:44:32 -05:00 committed by Barrett Ruth
parent 3cb872a65f
commit d274e0c117

View file

@ -346,6 +346,8 @@ function M.get_data_pretty()
return vim.inspect(cache_data)
end
M._cache = cache_data
function M.get_raw_cache()
return cache_data
end
return M