cp.nvim/lua/cp
Barrett Ruth 9f23076420 fix: cancel active process on contest switch
Problem: switching contests while a run, interactive session, or stress
test was in progress left orphaned callbacks and terminal jobs alive.
Running `:CP run` twice also allowed the first run's stale output to
overwrite the buffer after the second run completed.

Solution: replace the `io_view_running` bool in `views.lua` with a
generation counter (`_run_gen`); each `run_io_view` call increments it
and captures a local `gen`, and async callbacks bail out early when `gen
~= _run_gen`. Add `cancel_io_view`, `cancel_interactive` to `views.lua`
and `cancel` to `stress.lua` for forceful teardown without layout
restore. Call these in `setup_contest` whenever `is_new_contest` is true.
2026-03-05 17:37:13 -05:00
..
commands fix(submit): use file path over stdin; fix CF CodeMirror textarea (#305) 2026-03-05 14:34:14 -05:00
pickers fix(submit): use file path over stdin; fix CF CodeMirror textarea (#305) 2026-03-05 14:34:14 -05:00
runner fix(submit): use file path over stdin; fix CF CodeMirror textarea (#305) 2026-03-05 14:34:14 -05:00
ui fix: cancel active process on contest switch 2026-03-05 17:37:13 -05:00
cache.lua refactor(cache): nest credentials under platform namespace (#293) 2026-03-04 13:37:22 -05:00
config.lua refactor(run): remove I/O view test navigation keymaps 2026-03-04 00:26:22 -05:00
constants.lua fix(submit): use file path over stdin; fix CF CodeMirror textarea (#305) 2026-03-05 14:34:14 -05:00
credentials.lua feat: validate credentials on :CP <platform> login (#310) 2026-03-05 15:12:09 -05:00
health.lua fix: replace deprecated vim.loop with vim.uv 2026-02-26 22:45:07 -05:00
helpers.lua feat(ui): auto-hide source buffer on close 2025-10-24 14:47:12 -04:00
init.lua fix(submit): use file path over stdin; fix CF CodeMirror textarea (#305) 2026-03-05 14:34:14 -05:00
log.lua fix(submit): use file path over stdin; fix CF CodeMirror textarea (#305) 2026-03-05 14:34:14 -05:00
race.lua fix(submit): use file path over stdin; fix CF CodeMirror textarea (#305) 2026-03-05 14:34:14 -05:00
restore.lua fix(submit): use file path over stdin; fix CF CodeMirror textarea (#305) 2026-03-05 14:34:14 -05:00
scraper.lua feat: validate credentials on :CP <platform> login (#310) 2026-03-05 15:12:09 -05:00
setup.lua fix: cancel active process on contest switch 2026-03-05 17:37:13 -05:00
state.lua refactor(run): remove I/O view test navigation keymaps 2026-03-04 00:26:22 -05:00
stress.lua fix: cancel active process on contest switch 2026-03-05 17:37:13 -05:00
submit.lua fix(submit): use file path over stdin; fix CF CodeMirror textarea (#305) 2026-03-05 14:34:14 -05:00
utils.lua fix(submit): use file path over stdin; fix CF CodeMirror textarea (#305) 2026-03-05 14:34:14 -05:00
version.lua fix: refactor 2025-09-21 11:19:00 -04:00