Commit graph

36 commits

Author SHA1 Message Date
2a373b72dd
ci: format 2026-03-05 14:22:25 -05:00
29af2df858
refactor(logger): table-based LogOpts; add sync, on_done to test stream
Problem: `logger.log` positional args were hard to extend, and adding
`sync` support for pre-block notifications required a clean API. Test
stream completion had no user-visible signal. `setup_contest` could
silently overwrite files when a user's `filename` config returned
colliding paths.

Solution: Replace `(msg, level, override)` with `(msg, LogOpts?)` where
`LogOpts` carries `level`, `override`, and `sync`. Sync path calls
`vim.notify` directly; async path uses `vim.schedule` as before. Add
`on_done` callback to `scrape_all_tests`, fired via `on_exit` and
surfaced as a "Loaded N tests." notification. Detect filename collisions
in `proceed()` before touching the filesystem. Migrate all call sites.
2026-03-05 12:54:37 -05:00
f17eb32e8c fix: pass in index to :CP panel <n> 2026-03-04 00:30:39 -05:00
4f88b19a82 refactor(run): remove I/O view test navigation keymaps
Problem: <c-n>/<c-p> in the I/O view buffers required the cursor
to leave the source file to work, re-ran the solution on each
press, and gave no indication of which test was active. The
workflow is better served by :CP run <n> for a specific test or
:CP panel for full inspection.

Solution: remove navigate_test, next_test_key/prev_test_key config
options, and the associated current_test_index state field.
2026-03-04 00:26:22 -05:00
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
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
fef73887e4 feat(io): multi-test case view 2025-11-04 08:15:08 -05:00
Barrett Ruth
8345d147cf fix(ui): remove extra line from test cases 2025-10-24 21:31:03 -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
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
Renamed from lua/cp/ui/panel.lua (Browse further)