Commit graph

127 commits

Author SHA1 Message Date
08593d828d docs: add table of contents to vimdoc 2026-03-05 01:18:09 -05:00
Barrett Ruth
49e0ae3885
refactor(credentials): promote login/logout to top-level actions (#292)
## Problem

`:CP credentials login/logout/clear` is verbose and inconsistent with
other
actions that are all top-level (`:CP run`, `:CP submit`, etc.). The
clear-all
subcommand is also unnecessary since re-logging in overwrites existing
credentials.

## Solution

Replace `:CP credentials {login,logout,clear}` with `:CP login
[platform]`
and `:CP logout [platform]`. Remove the clear-all command and the
credentials
subcommand dispatch — login/logout are now regular actions routed
through the
standard action dispatcher.
2026-03-04 13:09:32 -05:00
Barrett Ruth
98ac0aa7a7
refactor(credentials): rename set/clear to login/logout/clear (#291)
## Problem

The `set` and `clear` subcommands don't clearly convey their intent —
`set`
reads like a generic setter rather than an auth action, and `clear`
overloads
single-platform and all-platform semantics in one subcommand.

## Solution

Rename `set` to `login`, split `clear` into `logout` (per-platform,
defaults
to active) and `clear` (all platforms).

New API:
- `:CP credentials login [platform]` — prompt and save credentials
- `:CP credentials logout [platform]` — remove credentials for one
platform
- `:CP credentials clear` — remove all stored credentials
2026-03-04 12:53:37 -05:00
a04702d87c refactor: replace :CP login with :CP credentials subcommand
Problem: :CP login was a poor API — no way to clear credentials without
raw Lua, and the single command didn't scale to multiple operations.

Solution: replace login with a :CP credentials subcommand following the
same pattern as :CP cache. :CP credentials set [platform] prompts and
saves; :CP credentials clear [platform] removes one or all platforms.
Add cache.clear_credentials(), rename login.lua to credentials.lua,
update parse/dispatch/tab-complete, and rewrite vimdoc accordingly.
2026-03-03 16:46:07 -05:00
3e0b7beabf feat: add :CP login command for explicit credential management
Problem: credentials were only set implicitly on first :CP submit.
There was no way to update wrong credentials, log out, or set
credentials ahead of time without editing the cache JSON manually.

Solution: add :CP login [platform] which always prompts for username
and password and overwrites any saved credentials for that platform.
Omitting the platform falls back to the active platform. Wire the
command through constants, parse_command, handle_command, and add
tab-completion (suggests platform names). Document in vimdoc under
the SUBMIT section and in the commands reference.
2026-03-03 16:28:54 -05:00
52cf54d05c docs: document new platforms, commands, and features
Problem: vimdoc only covered AtCoder, Codeforces, and CSES, and had no
entries for race, stress, or submit — all of which shipped in this
branch. The platform list was also stale and the workflow example
pointed users to the AtCoder website to submit manually.

Solution: add CodeChef, USACO, and Kattis to the supported platforms
list and platform-specific usage section (including Kattis's
dual single-problem/full-contest behavior). Document :CP stress,
:CP race, and :CP submit in the commands section, add their <Plug>
mappings, and add dedicated STRESS TESTING, RACE, and SUBMIT sections.
Update get_active_panel() to list its return values, add the
cp.race.status() API under the statusline section, and update the
workflow example step 8 to use :CP submit.
2026-03-03 16:02:09 -05:00
dc9cb10f3a doc: update 2026-03-03 00:54:13 -05:00
ce5648f9cf docs: add statusline integration recipes
Problem: cp.nvim exposed no documentation showing how to integrate its
runtime state into a statusline. Users had to discover the state module
API by reading source.

Solution: add a STATUSLINE INTEGRATION section to the vimdoc with a
state API reference and recipes for vanilla statusline, lualine, and
heirline. Also anchors the *cp.State* help tag referenced in prose
elsewhere in the doc.
2026-02-26 22:56:36 -05:00
Harivansh Rathi
1c31abe3d6 fix(open_url): open problem URL when switching problems
Also fix contest-change detection so URL open logic triggers when either platform or contest changes. This makes :CP next/:CP prev and problem jumps open the correct page when open_url is enabled.

Co-authored-by: Codex <noreply@openai.com>
2026-02-22 22:19:51 -05:00
49df7e015d docs: add setup section and reorder vimdoc
Problem: the vimdoc had no setup section, and configuration was buried
after commands and mappings.

Solution: add a cp-setup section with lazy.nvim example and move both
setup and configuration above commands for better discoverability.
2026-02-17 21:09:58 -05:00
029ea125b9 feat: add <Plug> mappings for all primary actions
Problem: users who want keybindings must call vim.cmd('CP run') or
reach into internal Lua modules directly. There is no stable,
discoverable, lazy-load-friendly public API for key binding.

Solution: define 7 <Plug> mappings in plugin/cp.lua that dispatch
through the same handle_command() code path as :CP. Document them
in a new MAPPINGS section in the vimdoc with helptags and an example
config block.
2026-02-07 13:23:45 -05:00
a54a06f939 refactor: rename vim.g.cp_config to vim.g.cp 2026-02-06 15:16:21 -05:00
ec487aa489 feat: config update to viom.g 2026-02-03 16:12:47 -05:00
5cd6f75419 fix username too 2026-02-01 17:11:51 -05:00
d89a40b21f feat: update git formatting 2026-01-27 17:18:52 -05:00
873ddee0d4 fix(doc): feature-parity 2026-01-27 14:30:22 -05:00
Barrett Ruth
127de3d6a5 fix 2025-11-04 23:39:43 -05:00
Barrett Ruth
bd557ab069 feat(doc): fix 2025-11-04 21:57:47 -05:00
Barrett Ruth
181fff42de feat(ui): documentation for :CP edit abilities 2025-10-24 16:35:00 -04:00
Barrett Ruth
a842886933 feat(ui): auto-hide source buffer on close 2025-10-24 14:47:12 -04:00
Barrett Ruth
4b1b75fd6e fix(config): padding spacing 2025-10-24 14:44:33 -04:00
Barrett Ruth
3daf582b7a feat(cache): update cache 2025-10-24 14:26:51 -04:00
Barrett Ruth
bd30fb626c feat: start lang refactor 2025-10-24 01:11:19 -04:00
Barrett Ruth
ce12ab0e1a minimize docs 2025-10-24 00:37:27 -04:00
Barrett Ruth
249e84eb5a feat: customization 2025-10-24 00:26:14 -04:00
Barrett Ruth
9ffc285e16 feat: document bdingins 2025-10-23 23:45:05 -04:00
Barrett Ruth
6a6cf2c594 feat: bindings and --debug flag 2025-10-23 23:36:09 -04:00
Barrett Ruth
038fcd36f8 feat(ui): fix alignment 2025-10-23 23:14:53 -04:00
Barrett Ruth
f45926c094 fix(docs): update for new features 2025-10-23 20:40:59 -04:00
Barrett Ruth
018d801121 fix: rename run panel to panel 2025-10-23 09:54:55 -04:00
352f98f26f fix: open problem-specific url 2025-10-15 11:00:31 -04:00
600a578a17 docs: update with open_url option 2025-10-12 16:20:14 -04:00
2b8bd503ad fix cmd help file 2025-10-05 18:45:38 -04:00
9134a0742b feat: update docs 2025-10-05 16:00:20 -04:00
1945999099 update docs 2025-10-05 13:16:14 -04:00
44bfc7317d feat(cli): :CP <problem_id> 2025-10-05 12:59:50 -04:00
fa2660455a default ansi colors 2025-10-05 12:38:49 -04:00
f5a72a3a8f doc cleanups 2025-10-05 12:32:43 -04:00
b68ecbbe96 rename and simplify things 2025-10-05 11:59:24 -04:00
a76d228e3f feat(doc): update for new config 2025-10-04 19:04:49 -04:00
2c0e808c8c update dcos 2025-10-04 17:48:35 -04:00
c627a40c0a fix: rename fields 2025-10-04 17:46:32 -04:00
aae98a5796 disable scraper disabling 2025-10-04 17:45:49 -04:00
ef8ee26edf remove per-problem language config 2025-10-04 16:26:01 -04:00
3fbbfa9423 normalize scraper behavior 2025-10-04 16:13:04 -04:00
5991670ef2 fix health and hl groups 2025-10-03 09:34:25 -04:00
82444412aa fix table 2025-10-03 00:04:20 -04:00
69ffc2d9dd cleanup 2025-10-02 23:07:10 -04:00
00a1d57005 fix missing key 2025-10-02 10:26:15 -04:00
57be0c0044 remove keys 2025-10-02 10:23:01 -04:00