Skip to content

Maktaba plugin bootstrap can fail with Unknown function: maktaba#Maktaba #239

@dbarnett

Description

@dbarnett

I ran into some strange initialization failures for the maktaba plugin when trying to bootstrap another plugin for testing. The error is Unknown function: maktaba#Maktaba and seems to be caused by a sort of circular dependency during setup. Not sure yet what specific circumstances make it blow up or not, since it's clearly not happening in day-to-day usage.

The failure scenario is:

  1. Calling an autoload function like maktaba#IsAtLeastVersion tries to load autoload/maktaba.vim and maktaba tries to GetOrInstall itself at
    let s:maktaba = maktaba#plugin#GetOrInstall(s:plugindir)
  2. That sources autoload/maktaba/plugin.vim which tries to call maktaba#Maktaba:
    let s:maktaba = maktaba#Maktaba()
  3. The call to maktaba#Maktaba() fails because vim is still in the middle of sourcing autoload/maktaba.vim from the first step. It hasn't gotten through the definition of maktaba#Maktaba() or the s:plugin variable it needs.

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