Commit graph

164 commits

Author SHA1 Message Date
Barrett Ruth
291de4e137
fix: expand language IDs, fix AtCoder submit, normalize logging (#353)
## Problem

Language version coverage was incomplete across all platforms, AtCoder
submit used a stale cookie fast-path that caused silent failures, and
raw
`vim.notify` calls throughout the codebase produced inconsistent or
missing `[cp.nvim]:` prefixes.

## Solution

Remove cookie persistence from AtCoder login/submit (always fresh
login),
increase the submit nav timeout to 40s, and switch to in-memory buffer
upload with the correct per-language extension from a full
`_LANGUAGE_ID_EXTENSION`
map covering all 116 AtCoder languages. Expand `LANGUAGE_VERSIONS` in
`constants.lua` with all AtCoder languages, 15 new CF languages with
full
version variants, and 50+ Kattis languages. Fix AtCoder `prolog` ID
(`6079`→`6081`, was Pony) and remove the non-existent `racket` entry.
Replace all raw `vim.notify` calls with `logger.log`. Simplify the
submit
language doc to point at `constants.lua` rather than maintaining a
static table.
2026-03-06 21:35:13 -05:00
Barrett Ruth
a202725cc5
fix(submit): use file path over stdin; fix CF CodeMirror textarea (#305)
## Problem

After the initial submit hardening, two issues remained: source code was
read in Lua and piped as stdin to the scraper (unnecessary roundtrip
since
the file exists on disk), and CF's `page.fill()` timed out on the hidden
`textarea[name="source"]` because CodeMirror owns the editor state.

## Solution

Pass the source file path as a CLI arg instead — AtCoder calls
`page.set_input_files(file_path)` directly, CF reads it with
`Path(file_path).read_text()`. Fix CF source injection via
`page.evaluate()`
into the CodeMirror instance. Extract `BROWSER_SUBMIT_NAV_TIMEOUT` as a
per-platform `defaultdict` (CF defaults to 2× nav timeout). Save the
buffer
with `vim.cmd.update()` before submitting.
2026-03-05 14:34:14 -05:00
6045042dfb fix: surface runtime check failures as clean notifications
Problem: when required dependencies (GNU time/timeout, Python env) are
missing, config.setup() throws a raw error() that surfaces as a Lua
traceback. On macOS without coreutils the message is also redundant
("GNU time not found: GNU time not found") and offers no install hint.

Solution: wrap config.setup() in pcall inside ensure_initialized(),
strip the Lua source-location prefix, and emit a vim.notify at ERROR
level. Add Darwin-specific install guidance to the GNU time/timeout
not-found messages. Pass capability reasons directly instead of
wrapping them in a redundant outer message.
2026-02-18 17:25:50 -05:00
de2bc07532 refactor: remove vim.g.cp_config compatibility shim
Problem: the deprecated vim.g.cp_config fallback was kept for
backwards compatibility after the rename to vim.g.cp in v0.7.6.

Solution: drop the shim entirely and update the setup() deprecation
target to v0.7.7.
2026-02-06 16:40:39 -05:00
a54a06f939 refactor: rename vim.g.cp_config to vim.g.cp 2026-02-06 15:16:21 -05:00
276241447c fix: add deprecation warning for setup()
Some checks are pending
luarocks / ci (push) Waiting to run
luarocks / publish (push) Blocked by required conditions
2026-02-03 21:46:47 -05:00
ec487aa489 feat: config update to viom.g 2026-02-03 16:12:47 -05:00
Barrett Ruth
13933fc7fd feat: clearcol 2025-10-23 12:10:14 -04:00
Barrett Ruth
018d801121 fix: rename run panel to panel 2025-10-23 09:54:55 -04:00
b68ecbbe96 rename and simplify things 2025-10-05 11:59:24 -04:00
d2bde9bad8 fix(config): better file org 2025-10-04 19:54:53 -04:00
1974addbd2 fix(lua): bunch of typing 2025-10-02 14:18:26 -04:00
a925686a17 fix(log): improve logging 2025-10-01 16:41:24 -04:00
22d0f72878 fix(ci): remove unused vars 2025-09-30 19:52:50 -04:00
dc4326524c fix(health): simplify health check 2025-09-30 19:49:10 -04:00
5a6902633f refactor: massive file restructure 2025-09-22 19:00:36 -04:00
b7ef866a14 fix: type errors 2025-09-22 18:51:07 -04:00
a69d9f3756 fix: type errors 2025-09-22 18:51:00 -04:00
510393a788 fix(logger): remove config 2025-09-22 16:48:50 -04:00
beda8a3a03 fix(logger): remove config 2025-09-22 16:48:46 -04:00
d7f5112841 fix(test): syntax 2025-09-22 16:47:28 -04:00
464ce8906c fix(test): require the state 2025-09-22 16:40:14 -04:00
7352189339 feat: refactor to state 2025-09-22 16:33:03 -04:00
355cb5df82 fix(diff): make git the second diff choice, not vim 2025-09-21 17:21:46 -04:00
ff20efca71 feat(diff): third, regular diff mode 2025-09-21 17:18:22 -04:00
d851dda461 fix(ci): fomrat 2025-09-21 15:10:27 -04:00
78fb4f8f4b feat(cache): cache clearing, updating and resetting 2025-09-21 15:08:55 -04:00
965e47a1df feat: refactor file structure 2025-09-21 14:29:01 -04:00
fdc1441fa3 fix: cleanup varnames 2025-09-21 12:29:28 -04:00
373e7f6e76 fix(test): mock caches and everything else 2025-09-21 12:26:06 -04:00
1822714a0c fix(picker): propagate logs 2025-09-21 12:24:42 -04:00
1b8365265d fix(ci): unused variables 2025-09-21 11:36:06 -04:00
a33e66680b feat(picker): picker support 2025-09-21 11:10:54 -04:00
d827b6dd0b feat(cese): normalize cses handling 2025-09-21 00:19:01 -04:00
03bb0bda33 fix(ci): typing 2025-09-21 00:16:14 -04:00
98aa3edd41 fix(ci): typing 2025-09-21 00:16:06 -04:00
3821174c6e fix(ci): typing 2025-09-21 00:15:51 -04:00
7a027c7379 fix(ci): typing 2025-09-21 00:15:23 -04:00
9deedec15a fix(scraper): comments 2025-09-21 00:10:10 -04:00
a8984d013a fix(cses): handle problem id uniquely 2025-09-21 00:06:52 -04:00
5bf9ae731f fix(ci): inline functions 2025-09-20 23:58:26 -04:00
7b8aae7921 fix(ci): move imports 2025-09-20 23:52:32 -04:00
847307bd1f fix(cache): actually use the cache 2025-09-20 22:30:21 -04:00
67fad79fb6 fix(panel): toggle state correctly 2025-09-20 22:18:55 -04:00
f3321f269d feat: warn ansi colors unset on fail 2025-09-20 16:38:37 -04:00
f60f6dd5bb feat(ansi): better logging and option to disab;e 2025-09-20 14:37:51 -04:00
35545a1ad2 feat(cses): integrate metadata command format in lua 2025-09-20 14:05:40 -04:00
cae0ea1914 fix(ci): duplicate varibale 2025-09-20 13:10:42 -04:00
b507dad4a7 feat: simplify ansi buffer approach 2025-09-20 12:52:12 -04:00
f8de0207ee feat: test -> run on filenames 2025-09-20 11:47:16 -04:00