disable scraper disabling

This commit is contained in:
Barrett Ruth 2025-10-04 17:45:49 -04:00
parent 0a320945a0
commit aae98a5796
9 changed files with 88 additions and 166 deletions

View file

@ -5,15 +5,11 @@ local logger = require('cp.log')
local state = require('cp.state')
function M.restore_from_current_file()
local current_file = vim.fn.expand('%:p')
if current_file == '' then
logger.log('No file is currently open.', vim.log.levels.ERROR)
return false
end
cache.load()
local current_file = vim.fn.expand('%:p')
local file_state = cache.get_file_state(current_file)
if not file_state then
if current_file or not file_state then
logger.log('No cached state found for current file.', vim.log.levels.ERROR)
return false
end
@ -27,13 +23,9 @@ function M.restore_from_current_file()
)
local setup = require('cp.setup')
if not setup.set_platform(file_state.platform) then
return false
end
local _ = setup.set_platform(file_state.platform)
state.set_contest_id(file_state.contest_id)
state.set_problem_id(file_state.problem_id)
setup.setup_contest(file_state.platform, file_state.contest_id, file_state.problem_id)
return true