disable scraper disabling
This commit is contained in:
parent
0a320945a0
commit
aae98a5796
9 changed files with 88 additions and 166 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue