fix types
This commit is contained in:
parent
db98153b11
commit
4f10377255
1 changed files with 8 additions and 2 deletions
|
|
@ -62,7 +62,10 @@ function M.toggle_interactive()
|
||||||
local cache = require('cp.cache')
|
local cache = require('cp.cache')
|
||||||
cache.load()
|
cache.load()
|
||||||
local contest_data = cache.get_contest_data(platform, contest_id)
|
local contest_data = cache.get_contest_data(platform, contest_id)
|
||||||
if contest_data and not contest_data.interactive then
|
if
|
||||||
|
contest_data
|
||||||
|
and not (contest_data or {}).problems[contest_data.index_map[state.get_current_problem_id]].interactive
|
||||||
|
then
|
||||||
logger.log('This is NOT an interactive problem. Use :CP run instead.', vim.log.levels.WARN)
|
logger.log('This is NOT an interactive problem. Use :CP run instead.', vim.log.levels.WARN)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
@ -154,7 +157,10 @@ function M.toggle_run_panel(is_debug)
|
||||||
local cache = require('cp.cache')
|
local cache = require('cp.cache')
|
||||||
cache.load()
|
cache.load()
|
||||||
local contest_data = cache.get_contest_data(platform, contest_id)
|
local contest_data = cache.get_contest_data(platform, contest_id)
|
||||||
if contest_data and contest_data.interactive then
|
if
|
||||||
|
contest_data
|
||||||
|
and not (contest_data or {}).problems[contest_data.index_map[state.get_current_problem_id]].interactive
|
||||||
|
then
|
||||||
logger.log('This is an interactive problem. Use :CP interact instead.', vim.log.levels.WARN)
|
logger.log('This is an interactive problem. Use :CP interact instead.', vim.log.levels.WARN)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue