fix(config): easier language default per-contest
This commit is contained in:
parent
d4f1678b03
commit
e48e70a5f9
3 changed files with 38 additions and 9 deletions
|
|
@ -267,12 +267,7 @@ function M.setup(user_config)
|
|||
error('No language configurations found')
|
||||
end
|
||||
|
||||
if vim.tbl_contains(available_langs, 'cpp') then
|
||||
contest_config.default_language = 'cpp'
|
||||
else
|
||||
table.sort(available_langs)
|
||||
contest_config.default_language = available_langs[1]
|
||||
end
|
||||
contest_config.default_language = available_langs[1]
|
||||
end
|
||||
end
|
||||
|
||||
|
|
|
|||
|
|
@ -159,8 +159,10 @@ end
|
|||
---@param contest_id string Contest identifier
|
||||
---@param problem_id string Problem identifier
|
||||
local function setup_problem(platform, contest_id, problem_id)
|
||||
local cp = require('cp')
|
||||
cp.handle_command({ fargs = { platform, contest_id, problem_id } })
|
||||
vim.schedule(function()
|
||||
local cp = require('cp')
|
||||
cp.handle_command({ fargs = { platform, contest_id, problem_id } })
|
||||
end)
|
||||
end
|
||||
|
||||
M.get_platforms = get_platforms
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue