feat(picker): open contest picker directly from :CP <platform>
Problem: `:CP codechef` (platform with no contest) returned a "too few arguments" error, forcing users to type `:CP pick` separately. Solution: When a platform name is given with no contest, parse it as a `pick` action with the platform pre-selected, skipping the platform selection step in the picker UI.
This commit is contained in:
parent
1f0414de8e
commit
645417f86b
4 changed files with 28 additions and 15 deletions
|
|
@ -64,7 +64,14 @@ local function contest_picker(opts, platform, refresh, language)
|
|||
:find()
|
||||
end
|
||||
|
||||
function M.pick(language)
|
||||
---@param language? string
|
||||
---@param platform? string
|
||||
function M.pick(language, platform)
|
||||
if platform then
|
||||
contest_picker({}, platform, false, language)
|
||||
return
|
||||
end
|
||||
|
||||
local opts = {}
|
||||
local platforms = picker_utils.get_platforms()
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue