Commit graph

104 commits

Author SHA1 Message Date
ad90d564ca fix(views): fix interactive guard logic and add stress panel support
Problem: toggle_interactive() had its condition inverted — it blocked
:CP interact on non-interactive problems while showing the message "This
problem is interactive", and passed through on interactive ones. The
panel guard in toggle_panel() was also missing a nil-check on
contest_data.index_map, which could crash if the index map was absent.

Solution: invert the toggle_interactive() guard to match the symmetrical
pattern in toggle_view(), fix the error message to say "not interactive",
and add the missing index_map guard. Also handle the stress panel type
in M.disable() so :CP stress can be toggled off.
2026-03-03 15:09:41 -05:00
72ea6249f4 ci: format 2026-03-03 00:46:59 -05:00
add022af8c refactor(hooks): replace flat hooks API with setup/on namespaces
Problem: the hooks API conflated distinct lifecycle scopes under a flat
table with inconsistent naming (setup_code, before_run, setup_io_input),
making it hard to reason about when each hook fires.

Solution: introduce two namespaces — hooks.setup.{contest,code,io} for
one-time initialization and hooks.on.{enter,run,debug} for recurring
events. hooks.setup.contest fires once when a contest dir is newly
created; hooks.on.enter is registered as a buffer-scoped BufEnter
autocmd and fires immediately after setup.code. The provisional buffer
setup_code callsite is removed as it ran on an unresolved temp buffer.
2026-03-03 00:46:59 -05:00
1162e7046b try to fix the setup 2026-02-18 14:13:37 -05:00
c8f735617a misc bugfixes 2026-02-02 13:13:08 -05:00
d89a40b21f feat: update git formatting 2026-01-27 17:18:52 -05:00
3348ac3e51 feat: improve formatting 2026-01-27 16:48:04 -05:00
ee38da5074 feat(layout): change formatting 2026-01-27 16:47:50 -05:00
9af359eb01 feat(layout): cleanup mode labels 2026-01-27 16:47:42 -05:00
fb7888b83c feat(highlight): use default highlights 2026-01-27 14:27:41 -05:00
4c5c44742e feat: refactors 2026-01-27 14:23:23 -05:00
ba26cee7f9 feat(run): make running entirely asynchronous 2026-01-27 12:55:35 -05:00
c8c0da6d61 fix(ci): format 2026-01-27 12:27:09 -05:00
d40d80c541 fix: race condition & logs 2026-01-27 12:22:53 -05:00
fa45d912b8 close out other bufs on source buf close 2025-12-31 13:06:25 -06:00
10b3dcd846 fix: add debug log 2025-12-14 16:23:14 -06:00
Barrett Ruth
71863fde7f fix(io): validate view later 2025-11-06 01:46:10 -05:00
Barrett Ruth
00987bb0ff feat(io): cleanup view 2025-11-06 01:31:50 -05:00
Barrett Ruth
07e4372a4a cleanup 2025-11-06 00:18:09 -05:00
Barrett Ruth
0e778a128e Merge main into feat/io/view-togggle
Resolved conflicts:
- scrapers/atcoder.py: kept defensive if tests else '' checks
- scrapers/codechef.py: kept defensive if tests else '' checks
- tests/test_scrapers.py: kept comprehensive validation from main
- lua/cp/ui/views.lua: removed misplaced navigation code from loop
2025-11-05 23:01:04 -05:00
Barrett Ruth
7d8d00c5ad fix(ui): correct output buf 2025-11-05 13:10:17 -05:00
Barrett Ruth
13d931ed19 feat: update 2025-11-05 12:47:38 -05:00
Barrett Ruth
127de3d6a5 fix 2025-11-04 23:39:43 -05:00
Barrett Ruth
1b0d5e4d77 feat: fix typign 2025-11-04 22:08:07 -05:00
Barrett Ruth
e1c8c4beaf feat(cli): :CP run with numbered test cases 2025-11-04 21:45:45 -05:00
Barrett Ruth
aab211902e feat: multi-test case view 2025-11-04 21:32:40 -05:00
Barrett Ruth
9238118fbe fix(ci): formatting 2025-11-04 08:33:56 -05:00
Barrett Ruth
6a61780928 fix(ci): typing 2025-11-04 08:19:14 -05:00
Barrett Ruth
fef73887e4 feat(io): multi-test case view 2025-11-04 08:15:08 -05:00
Barrett Ruth
9b90e3a452 feat(ui): close all buffers on edit 2025-10-24 21:40:13 -04:00
Barrett Ruth
8345d147cf fix(ui): remove extra line from test cases 2025-10-24 21:31:03 -04:00
Barrett Ruth
b736fd0131 feat(ui): test editor 2025-10-24 17:02:43 -04:00
Barrett Ruth
11b6056d8c fix 2025-10-24 16:13:52 -04:00
Barrett Ruth
de45fd3393 fix: modernize use of vim.cmd 2025-10-24 15:16:22 -04:00
Barrett Ruth
8ffa3cb0d2 fix: modernize use of typing 2025-10-24 15:10:58 -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
b3168ff3f0 feat: center the curso 2025-10-24 14:03:00 -04:00
Barrett Ruth
249e84eb5a feat: customization 2025-10-24 00:26:14 -04:00
Barrett Ruth
6f9452c7e1 renme 2025-10-23 23:57:23 -04:00
Barrett Ruth
7e2e712b56 fix: rename file 2025-10-23 23:55:27 -04:00
Barrett Ruth
64b8b03cca fix var name 2025-10-23 23:49:50 -04:00
Barrett Ruth
82021e3d97 fix ci 2025-10-23 23:48:32 -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
92ffa41ed0 feat: fix test rendering 2025-10-23 23:02:48 -04:00
Barrett Ruth
60e5aabd99 fix types 2025-10-23 20:15:16 -04:00
Barrett Ruth
99544905df fix current mode 2025-10-23 20:04:36 -04:00
Barrett Ruth
59f5066327 fix input display 2025-10-23 20:03:17 -04:00