From f0fbb157651f94b47f4b18404864dc1f8859659b Mon Sep 17 00:00:00 2001 From: Barrett Ruth Date: Fri, 26 Sep 2025 09:28:23 -0400 Subject: [PATCH] fix: default contest config --- lua/cp/config.lua | 17 ++++++++++++----- lua/cp/setup.lua | 3 ++- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/lua/cp/config.lua b/lua/cp/config.lua index fe58369..ed0c5f0 100644 --- a/lua/cp/config.lua +++ b/lua/cp/config.lua @@ -68,20 +68,27 @@ local M = {} local constants = require('cp.constants') -local default_cpp_config = { +local default_contest_config = { cpp = { compile = { 'g++', '-std=c++17', '{source}', '-o', '{binary}' }, debug = { 'g++', '-std=c++17', '-fsanitize=address,undefined', '{source}', '-o', '{binary}' }, - extension = 'cpp', + test = { '{binary}' }, }, + python = { + test = { '{source}' }, + debug = { '{source}' }, + executable = 'python', + extension = 'py', + }, + default_language = 'cpp', } ---@type cp.Config M.defaults = { contests = { - codeforces = default_cpp_config, - atcoder = default_cpp_config, - cses = default_cpp_config, + codeforces = default_contest_config, + atcoder = default_contest_config, + cses = default_contest_config, }, snippets = {}, hooks = { diff --git a/lua/cp/setup.lua b/lua/cp/setup.lua index a53c12e..7a77d62 100644 --- a/lua/cp/setup.lua +++ b/lua/cp/setup.lua @@ -99,7 +99,8 @@ function M.setup_problem(contest_id, problem_id, language) state.set_contest_id(contest_id) state.set_problem_id(problem_id) - state.set_run_panel_active(false) + -- TODO: why comment this out + -- state.set_active_panel('run') vim.schedule(function() local ok, err = pcall(function()