Skip to content

fix(light): classic zi light loads with full tracking, like zi load #586

Description

@ss-o

Environment

  • Zi next at 3fa8433 (GitHub tarball), Zsh 5.9.2, Linux x86_64, zsh -f.

Minimal reproduction

A local plugin directory demo holding demo.plugin.zsh:

demo_fn() { :; }
bindkey "^X^D" demo_fn

Load it once in each of three fresh zsh -f shells, each sourcing zi.zsh, then print the plugin's state records from ZI:

zi light /path/to/demo            # shell 1
zi light-mode for /path/to/demo   # shell 2
zi load /path/to/demo             # shell 3
for k in ${(k)ZI}; do
  [[ $k == (STATES__*|FUNCTIONS_BEFORE__*|BINDKEYS__*) ]] && print -r -- "$k=${ZI[$k][1,40]}"
done

Actual behavior

Command STATES__%.../demo FUNCTIONS_BEFORE__ BINDKEYS__
zi light /path/to/demo 2 recorded ^X^D demo_fn recorded
zi light-mode for /path/to/demo 1 empty empty
zi load /path/to/demo 2 recorded ^X^D demo_fn recorded

Classic zi light loads the plugin with full tracking, exactly like zi load. The classic-syntax branch in zi.zsh sets ICE[light-mode]= (line 3030 on next) and then runs ICE=() ZI_ICE=() (line 3035) after copying ICE into ZI_ICES, so the light flag does not reach the load.

Expected behavior

zi light loads without tracking, as README.md:75 ("light loads a plugin without tracking and reporting overhead") and docs/man/zi.1:562 ("Light plugin load, without reporting/tracking") say: the same records as zi light-mode for (STATES__ 1, no function or bindkey records). zi light -b should keep tracking bindkey calls only.

Found while reviewing the unload work for #113 and #582; it is not part of those issues.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:ziZi core behavior, APIs, or documentation.type:bugSomething is broken or behaving incorrectly.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions