warn when :CP <platform> <contest> is run for a disabled platform #326

Closed
opened 2026-03-06 16:47:17 +00:00 by barrettruth · 1 comment
barrettruth commented 2026-03-06 16:47:17 +00:00

Problem

Running `:CP codeforces 1234` when `codeforces` is not listed in `enabled_platforms` (or the platform key is absent from `config.platforms`) silently does nothing or produces a confusing internal error. There is no user-facing warning.

Solution

Before initiating a fetch in `setup.setup_contest`, check that the platform is present and enabled in the config. If not, emit a clear `vim.log.levels.ERROR` notification: e.g. `"Platform 'X' is not enabled. Add it to platforms in your cp.nvim config."`

## Problem Running \`:CP codeforces 1234\` when \`codeforces\` is not listed in \`enabled_platforms\` (or the platform key is absent from \`config.platforms\`) silently does nothing or produces a confusing internal error. There is no user-facing warning. ## Solution Before initiating a fetch in \`setup.setup_contest\`, check that the platform is present and enabled in the config. If not, emit a clear \`vim.log.levels.ERROR\` notification: e.g. \`"Platform 'X' is not enabled. Add it to platforms in your cp.nvim config."\`
barrettruth commented 2026-03-06 21:20:25 +00:00

Resolved by #336.

Resolved by #336.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
barrettruth/cp.nvim#326
No description provided.