Skip to content

Vim9: Cannot import autoload when package is a symlink #10960

@cykerway

Description

@cykerway

Steps to reproduce

  1. Prepare a package like this:

    ~/.vim/pack/xxx/start/foobar/
    ├── autoload
    │   └── bar.vim
    └── plugin
        └── foo.vim
    
    vim9script
    #foo.vim
    import autoload 'bar.vim'
    echo bar.F
    echo bar.V
    
    vim9script
    #bar.vim
    export def F()
    enddef
    export var V = 'V'
    
  2. Run vim and to get the correct result:

    bar#F
    V
    
  3. Now make the package a symlink:

    cd ~/.vim/pack/xxx/start/
    mv foobar /tmp/
    ln -s /tmp/foobar/ .
    
  4. Run vim again and it gives error:

    bar#F
    Error detected while processing /tmp/foobar/plugin/foo.vim:
    line    4:
    E1048: Item not found in script: V
    

    As you see it can find the function but not the variable.

Expected behaviour

Give the same result whether package is a symlink or not.

Version of Vim

9.0.77

Environment

Fedora 36, Bash 5.1.16

Logs and stack traces

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions