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
|
|
@ -453,6 +453,7 @@ COMMANDS *cp-commands*
|
|||
any previously saved credentials.
|
||||
If [platform] is omitted, uses the active platform.
|
||||
Examples: >
|
||||
:CP login
|
||||
:CP login atcoder
|
||||
:CP login codeforces
|
||||
<
|
||||
|
|
@ -460,6 +461,7 @@ COMMANDS *cp-commands*
|
|||
Remove stored credentials for a platform.
|
||||
If [platform] is omitted, uses the active platform.
|
||||
Examples: >
|
||||
:CP logout
|
||||
:CP logout atcoder
|
||||
<
|
||||
:CP {platform} signup
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue