Merge pull request #238 from barrettruth/fix/setup-code-hook-language

fix(setup): set language state before setup_code hook on first open
This commit is contained in:
Barrett Ruth 2026-02-06 16:38:41 -05:00 committed by GitHub
commit 041e09ac04
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -160,6 +160,8 @@ function M.setup_contest(platform, contest_id, problem_id, language)
vim.bo[bufnr].buftype = ''
vim.bo[bufnr].swapfile = false
state.set_language(lang)
if cfg.hooks and cfg.hooks.setup_code and not vim.b[bufnr].cp_setup_done then
local ok = pcall(cfg.hooks.setup_code, state)
if ok then