fix ci
This commit is contained in:
parent
9ffc285e16
commit
82021e3d97
2 changed files with 10 additions and 9 deletions
|
|
@ -17,6 +17,7 @@ local actions = constants.ACTIONS
|
||||||
---@field problem_id? string
|
---@field problem_id? string
|
||||||
---@field interactor_cmd? string
|
---@field interactor_cmd? string
|
||||||
---@field test_index? integer
|
---@field test_index? integer
|
||||||
|
---@field debug? boolean
|
||||||
|
|
||||||
--- Turn raw args into normalized structure to later dispatch
|
--- Turn raw args into normalized structure to later dispatch
|
||||||
---@param args string[] The raw command-line mode args
|
---@param args string[] The raw command-line mode args
|
||||||
|
|
|
||||||
|
|
@ -247,29 +247,29 @@ function M.ensure_io_view()
|
||||||
current_test_index = 1,
|
current_test_index = 1,
|
||||||
})
|
})
|
||||||
|
|
||||||
local config = config_module.get_config()
|
local cfg = config_module.get_config()
|
||||||
if config.hooks and config.hooks.setup_io_output then
|
if cfg.hooks and cfg.hooks.setup_io_output then
|
||||||
pcall(config.hooks.setup_io_output, output_buf, state)
|
pcall(cfg.hooks.setup_io_output, output_buf, state)
|
||||||
end
|
end
|
||||||
|
|
||||||
if config.hooks and config.hooks.setup_io_input then
|
if cfg.hooks and cfg.hooks.setup_io_input then
|
||||||
pcall(config.hooks.setup_io_input, input_buf, state)
|
pcall(cfg.hooks.setup_io_input, input_buf, state)
|
||||||
end
|
end
|
||||||
|
|
||||||
local function navigate_test(delta)
|
local function navigate_test(delta)
|
||||||
local io_state = state.get_io_view_state()
|
local io_view_state = state.get_io_view_state()
|
||||||
if not io_state then
|
if not io_view_state then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local test_cases = cache.get_test_cases(platform, contest_id, problem_id)
|
local test_cases = cache.get_test_cases(platform, contest_id, problem_id)
|
||||||
if not test_cases or #test_cases == 0 then
|
if not test_cases or #test_cases == 0 then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local new_index = (io_state.current_test_index or 1) + delta
|
local new_index = (io_view_state.current_test_index or 1) + delta
|
||||||
if new_index < 1 or new_index > #test_cases then
|
if new_index < 1 or new_index > #test_cases then
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
io_state.current_test_index = new_index
|
io_view_state.current_test_index = new_index
|
||||||
M.run_io_view(new_index)
|
M.run_io_view(new_index)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue