diff --git a/.gitignore b/.gitignore index 780dcd2..ddee7e1 100644 --- a/.gitignore +++ b/.gitignore @@ -6,3 +6,4 @@ io debug venv/ CLAUDE.md +__pycache__ diff --git a/doc/cp.nvim.txt b/doc/cp.nvim.txt index 2557fb8..ac993b7 100644 --- a/doc/cp.nvim.txt +++ b/doc/cp.nvim.txt @@ -211,7 +211,8 @@ run CSES problems with Rust using the single schema: Should return full filename with extension. (default: concatenates contest_id and problem_id, lowercased) {ui} (|CpUI|) UI settings: run panel, diff backend, picker. - {open_url} (boolean) Open the contest url in the browser. + {open_url} (boolean) Open the contest & problem url in the browser + when the contest is first opened. *CpPlatform* Fields: ~ diff --git a/lua/cp/setup.lua b/lua/cp/setup.lua index f0001a8..6dd579f 100644 --- a/lua/cp/setup.lua +++ b/lua/cp/setup.lua @@ -84,7 +84,7 @@ function M.setup_contest(platform, contest_id, problem_id, language) start_tests(platform, contest_id, problems) if config_module.get_config().open_url and is_new_contest and contest_data.url then - vim.ui.open(contest_data.url) + vim.ui.open(contest_data.url:format(pid)) end end diff --git a/scrapers/atcoder.py b/scrapers/atcoder.py index f565104..41f50ad 100644 --- a/scrapers/atcoder.py +++ b/scrapers/atcoder.py @@ -286,7 +286,7 @@ class AtcoderScraper(BaseScraper): error="", contest_id=cid, problems=problems, - url=f"https://atcoder.jp/contests/{contest_id}/tasks", + url=f"https://atcoder.jp/contests/{contest_id}/tasks/{contest_id}_%s", ) return await self._safe_execute("metadata", impl, contest_id) diff --git a/scrapers/codeforces.py b/scrapers/codeforces.py index 10287ae..c540ba1 100644 --- a/scrapers/codeforces.py +++ b/scrapers/codeforces.py @@ -202,7 +202,7 @@ class CodeforcesScraper(BaseScraper): error="", contest_id=cid, problems=problems, - url=f"https://codeforces.com/contest/{contest_id}", + url=f"https://codeforces.com/contest/{contest_id}/%s", ) return await self._safe_execute("metadata", impl, contest_id) diff --git a/scrapers/cses.py b/scrapers/cses.py index 434e8a4..b8a6145 100644 --- a/scrapers/cses.py +++ b/scrapers/cses.py @@ -200,7 +200,7 @@ class CSESScraper(BaseScraper): error="", contest_id=contest_id, problems=problems, - url="https://cses.fi/problemset", + url="https://cses.fi/problemset/task/%s", ) async def scrape_contest_list(self) -> ContestListResult: