fix: language version IDs, cache crash, and stress session restore (#352)

## Problem

Codeforces language version IDs were wrong (pointed at old compiler
versions), `LANGUAGE_VERSIONS` was incomplete for most platforms, the
contest picker crashed when `supports_countdown` was stored as a
non-table entry, and `:CP stress` restored a broken IO view on exit.

## Solution

Correct CF `programTypeId` values and default to C++20. Add
`LANGUAGE_VERSIONS` entries for all six platforms. Guard
`get_contest_summaries` against non-table cache entries. Call
`ensure_io_view()` after stress session restore. Shorten the stress
terminal buffer name to a readable `term://stress.py` format.
This commit is contained in:
Barrett Ruth 2026-03-06 20:22:28 -05:00 committed by GitHub
parent 425a8f36e9
commit 1ac521a126
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 22 additions and 11 deletions

View file

@ -53,7 +53,7 @@ local function build_run_cmd(file)
end
return './' .. bin
elseif ext == 'py' then
return 'python3 ' .. file
return 'python ' .. file
end
return './' .. file
end
@ -72,6 +72,7 @@ function M.toggle(generator_cmd, brute_cmd)
state.saved_stress_session = nil
end
state.set_active_panel(nil)
require('cp.ui.views').ensure_io_view()
return
end
@ -128,6 +129,7 @@ function M.toggle(generator_cmd, brute_cmd)
vim.fn.delete(state.saved_stress_session)
state.saved_stress_session = nil
end
require('cp.ui.views').ensure_io_view()
end
execute.compile_problem(false, function(compile_result)
@ -169,6 +171,11 @@ function M.toggle(generator_cmd, brute_cmd)
vim.cmd.terminal(cmdline)
local term_buf = vim.api.nvim_get_current_buf()
pcall(
vim.api.nvim_buf_set_name,
term_buf,
("term://stress.py '%s' '%s' '%s'"):format(gen_cmd, brute_run_cmd, binary)
)
local term_win = vim.api.nvim_get_current_win()
local cleaned = false