fix caching

This commit is contained in:
Barrett Ruth 2025-10-01 20:21:11 -04:00
parent e6c09a4897
commit 7eb314b02c
7 changed files with 79 additions and 85 deletions

View file

@ -15,7 +15,7 @@ function M.restore_from_current_file()
local file_state = cache.get_file_state(current_file)
if not file_state then
logger.log(
'No cached state found for current file. Use :CP <platform> <contest> <problem> [...] first.',
'No cached state found for current file. Use :CP <platform> <contest> [--{lang=<lang>,debug}...] first.',
vim.log.levels.ERROR
)
return false
@ -37,7 +37,12 @@ function M.restore_from_current_file()
state.set_contest_id(file_state.contest_id)
state.set_problem_id(file_state.problem_id)
setup.setup_problem(file_state.contest_id, file_state.problem_id, file_state.language)
setup.setup_contest(
file_state.platform,
file_state.contest_id,
file_state.language,
file_state.problem_id
)
return true
end