Skip to content

The ensure_installed option does not work when using lazy.nvim with event='VeryLazy' #39

@bcampolo

Description

@bcampolo

Currently mason-tools-installer calls run_on_start during the VimEnter event (as seen below), but when using lazy.nvim with event set to 'VeryLazy', the plugin has not been loaded yet when VimEnter occurs so the run_on_start command never runs.

https://github.com/WhoIsSethDaniel/mason-tool-installer.nvim/blob/8b70e7f1e0a4119c1234c3bde4a01c241cabcc74/plugin/mason-tool-installer.lua#L1C1-L3C3

vim.api.nvim_create_autocmd({ 'VimEnter' }, {
  callback = require('mason-tool-installer').run_on_start,
})

I'm not sure what the preferred way to fix this would be, but for now I am able to work around the problem, but explicitly running:
vim.api.nvim_command('MasonToolsInstall')
in my lazy spec config function after the setup method is called.

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