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:
parent
e3c81e895a
commit
693d3bf172
3 changed files with 32 additions and 6 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue