feat(commands): standalone :CP login/logout with auto-restore

Problem: `:CP login` and `:CP logout` only worked as `:CP <platform>
login`. Users with an active platform or in a registered buffer had to
type the platform name redundantly.

Solution: Parse standalone `login`/`logout`/`signup` as action commands
with `requires_context = true`, resolving the platform from state (or
auto-restoring from the current buffer). Add `vim.cmd.redraw()` after
auto-restore so the screen updates before any prompt. Add `login`/
`logout` to top-level completion when a platform is active.
This commit is contained in:
Barrett Ruth 2026-03-07 18:13:12 -05:00
parent e3c81e895a
commit 693d3bf172
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
3 changed files with 32 additions and 6 deletions

View file

@ -43,6 +43,10 @@ end, {
vim.list_extend(candidates, platforms)
table.insert(candidates, 'cache')
table.insert(candidates, 'pick')
if platform then
table.insert(candidates, 'login')
table.insert(candidates, 'logout')
end
if platform and contest_id then
vim.list_extend(
candidates,