zdharma-continuum / zinit

🌻 Flexible and fast ZSH plugin manager
MIT License
2.77k stars 123 forks source link

[bug]: `unload` and `load` behavior inconsistent #513

Open vladdoster opened 1 year ago

vladdoster commented 1 year ago

What happened?

I suspect this is inconsistent behavior

Steps to reproduce

  1. Run the following snippet:

    zi ice \
    compile'key-bindings.zsh' \
    dl="$(builtin print -c -- https://raw.githubusercontent.com/junegunn/fzf/master/{shell/{'key-bindings.zsh;','completion.zsh -> _fzf;'},man/{'man1/fzf.1 -> $ZPFX/share/man/man1/fzf.1;','man1/fzf-tmux.1 -> $ZPFX/share/man/man1/fzf-tmux.1;'}})" \
    from'gh-r' \ 
    lbin'!' \
    null \
    src'key-bindings.zsh' \
    @junegunn/fzf
  2. Run zi unload junegunn/fzf

  3. Run zi load junegunn/fzf

  4. Run zi unload junegunn/fzf

Relevant output

Report for junegunn/fzf plugin
------------------------------
Source key-bindings.zsh (reporting enabled)
Zle -N fzf-file-widget
Note: a new widget created via zle -N: `fzf-file-widget'
Bindkey -M emacs '^T' fzf-file-widget
Bindkey -M vicmd '^T' fzf-file-widget
Bindkey -M viins '^T' fzf-file-widget
Zle -N fzf-cd-widget
Note: a new widget created via zle -N: `fzf-cd-widget'
Bindkey -M emacs '\ec' fzf-cd-widget
Bindkey -M vicmd '\ec' fzf-cd-widget
Bindkey -M viins '\ec' fzf-cd-widget
Zle -N fzf-history-widget
Note: a new widget created via zle -N: `fzf-history-widget'
Bindkey -M emacs '^R' fzf-history-widget
Bindkey -M vicmd '^R' fzf-history-widget
Bindkey -M viins '^R' fzf-history-widget

Functions created:
__fsel             __fzfcmd
fzf-cd-widget      fzf-file-widget
fzf-history-widget 

Completions:
_fzf [enabled]

Screenshots and recordings

Screenshot 2023-05-01 at 00 19 52

Operating System & Version

OS: darwin22.2.0 | Vendor: apple | Machine: arm | CPU: arm64 | Processor: arm | Hardware: arm64

Zsh version

zsh 5.9.0.1-dev (arm-apple-darwin22.2.0)

Terminal emulator

xterm-kitty

If using WSL on Windows, which version of WSL

None

Additional context

No response

Code of Conduct