zdharma-continuum / zinit

🌻 Flexible and fast ZSH plugin manager
MIT License
3.09k stars 128 forks source link

Fix #396 #398

Closed Freed-Wu closed 1 year ago

Freed-Wu commented 2 years ago

Description

Now the context is correct.

❯ zinit cd <C-X>h
tags in context :completion::complete:zinit::
    argument-rest  (_arguments _zinit)
tags in context :completion::complete:zinit-cd::
    dsnippets lsnippets plugins  (_zinit)

Motivation and Context

Use can use different context to zstyle some different behaviour.

Related Issue(s)

Fix #396

Usage examples

How Has This Been Tested?

Types of changes

Checklist:

vladdoster commented 2 years ago

I don't quite understand the fix here. Could you elaborate?

Freed-Wu commented 2 years ago

Before:

❯ zinit cd fzf-tab-source
tags in context :completion::complete:zinit::
    argument-rest  (_arguments _zinit)
tags in context :completion::complete:zinit:argument-rest:
    dsnippets lsnippets plugins  (_zinit)
❯ zinit edit
tags in context :completion::complete:zinit::
    argument-rest  (_arguments _zinit)
tags in context :completion::complete:zinit:argument-rest:
    dsnippets lsnippets plugins  (_zinit)

After

❯ zinit cd fzf-tab-source
tags in context :completion::complete:zinit::
    argument-rest  (_arguments _zinit)
tags in context :completion::complete:zinit-cd::
    dsnippets lsnippets plugins  (_zinit)
❯ zinit edit
tags in context :completion::complete:zinit::
    argument-rest  (_arguments _zinit)
tags in context :completion::complete:zinit-edit:
    dsnippets lsnippets plugins  (_zinit)

It allows user customize different behaviour in different context.

vladdoster commented 1 year ago

Can you rebase your branch onto main so the checks will pass?

Freed-Wu commented 1 year ago

OK.

Freed-Wu commented 1 year ago

All tests passed.

Freed-Wu commented 1 year ago

Is any other problem? @vladdoster

Freed-Wu commented 1 year ago

@pschmitt

Freed-Wu commented 1 year ago

@vladdoster @pschmitt

vladdoster commented 1 year ago

@Freed-Wu,

Resolve merge conflicts and I will merge.

Freed-Wu commented 1 year ago

https://github.com/zdharma-continuum/zinit/blob/main/_zinit#L366 has fixed.