Skip to content

lazy-loading creates "attempt to assign private in nested scope" error #87

Open
@andronocean

Description

@andronocean

Hi, and thanks for this great project. I'm having an issue when loading zsh-nvm using zsh-snap ("znap") plugin manager with the setup shown at marlonrichert/zsh-launchpad.

I get this error: cmd: attempt to assign private in nested scope, related to this line in the _zsh_nvm_lazy_load function:

for cmd in $cmds; do

I think this is happening since my .zshrc is configured to znap source plugins inside an anonymous function.

I was able to fix it by explicitly marking cmd as local:

# Create function for each command
  local cmd
  for cmd in $cmds; do

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions