feat: a link brings back the lazysecrets nvim hid; Azure shows its account (#95)
- In nvim, lazysecrets asks lazysecrets.nvim whether its window is shown: a hidden one is brought back for a link, unless nvim is busy (typing, a command, a picker, mid-operator), when the link opens elsewhere. Without an answer (an older plugin), nothing changes. - The Azure group is named for its account, Azure · alice, also with a single account; its ID, and so stars and cache, stay as they were. Needs keb/lazysecrets.nvim#6 for the reveal; without it, links behave as before. Reviewed-on: #95 Co-authored-by: Karl-Einar Bergstrøm <karl-einarb@outlook.com>
This commit was merged in pull request #95.
This commit is contained in:
1 parent
677bba4c4a
commit
99e6b7bcd8
7 files changed
+128
-8
No files matched your search
@@ -181,10 +181,9 @@ func NewAccounts(s Settings) ([]*Provider, error) {
|
||||
if i > 0 {
|
||||
settings.Vaults = nil
|
||||
}
|
||||
label := ""
|
||||
if len(accounts) > 1 {
|
||||
label = string(provider.KindAzure) + " · " + labels[i]
|
||||
}
|
||||
// Named for its account, also when it's the only one: which
|
||||
// account lazysecrets sees Azure through is worth seeing.
|
||||
label := string(provider.KindAzure) + " · " + labels[i]
|
||||
cred := authCredential{
|
||||
cred: newCLICredential(a.user, a.tenant, func() ([]account, error) { return readAccounts(path) }),
|
||||
login: []string{"az", "login", "--tenant", a.tenant},
|
||||
@@ -195,9 +194,9 @@ func NewAccounts(s Settings) ([]*Provider, error) {
|
||||
return nil, err
|
||||
}
|
||||
p.account = &accountDetails{account: a, claims: cred.cred.(*cliCredential).claims}
|
||||
if label != "" {
|
||||
p.label = label
|
||||
if len(accounts) > 1 { // one keeps the plain ID its stars and cache are under
|
||||
p.id = string(provider.KindAzure) + ":" + a.user + "/" + a.tenant
|
||||
p.label = label
|
||||
}
|
||||
out = append(out, p)
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user