fix(setup): cancel all active panels on problem navigation
Problem: `navigate_problem` only called `views.disable()` for the `'run'` panel; interactive and stress terminals were left alive when stepping through problems with `:CP next/prev`. In-flight `run_io_view` callbacks were also not invalidated since `is_new_contest` stays false for same-contest navigation, so the generation-counter guard in `setup_contest` never fired. Solution: call `cancel_io_view()` unconditionally in `navigate_problem` and expand the panel dispatch to cover `'interactive'` and `'stress'` alongside `'run'`, mirroring the contest-switch logic in `setup_contest`.
This commit is contained in:
parent
9cf9cd8441
commit
73be6b8277
1 changed files with 7 additions and 1 deletions
|
|
@ -477,9 +477,15 @@ function M.navigate_problem(direction, language)
|
|||
|
||||
logger.log(('navigate_problem: %s -> %s'):format(current_problem_id, problems[new_index].id))
|
||||
|
||||
local views = require('cp.ui.views')
|
||||
views.cancel_io_view()
|
||||
local active_panel = state.get_active_panel()
|
||||
if active_panel == 'run' then
|
||||
require('cp.ui.views').disable()
|
||||
views.disable()
|
||||
elseif active_panel == 'interactive' then
|
||||
views.cancel_interactive()
|
||||
elseif active_panel == 'stress' then
|
||||
require('cp.stress').cancel()
|
||||
end
|
||||
|
||||
local lang = nil
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue