Skip to content

fix: lazy-loaded plugins not fully activating#8

Merged
zuqini merged 1 commit intomainfrom
zuqini/lazy-loading-bug
Apr 8, 2026
Merged

fix: lazy-loaded plugins not fully activating#8
zuqini merged 1 commit intomainfrom
zuqini/lazy-loading-bug

Conversation

@zuqini
Copy link
Copy Markdown
Owner

@zuqini zuqini commented Apr 8, 2026

Three issues preventing lazy plugins from working correctly:

  1. Event trigger not re-firing: the event handler loaded plugins but didn't re-fire the triggering event (e.g. InsertEnter), so plugins like nvim-cmp loaded but never activated. The ft handler already did this correctly.

  2. packadd not sourcing after/plugin/ files: when vim.pack.add() pre-registers plugins on the rtp, subsequent packadd calls skip sourcing plugin/ and after/plugin/ files. This broke plugins like cmp-buffer that register via after/plugin/ scripts. Added explicit source_plugin_files() to handle this for both lazy and startup paths.

  3. Single dependency specs silently losing fields: normalize_dependencies treated { "user/repo", opts = {} } as a string list, dropping hash keys like opts, init, config via ipairs. Fixed is_single_spec to detect non-integer keys, so single specs with options are preserved.

Addresses #7

Three issues preventing lazy plugins from working correctly:

1. Event trigger not re-firing: the event handler loaded plugins but
   didn't re-fire the triggering event (e.g. InsertEnter), so plugins
   like nvim-cmp loaded but never activated. The ft handler already
   did this correctly.

2. packadd not sourcing after/plugin/ files: when vim.pack.add()
   pre-registers plugins on the rtp, subsequent packadd calls skip
   sourcing plugin/ and after/plugin/ files. This broke plugins like
   cmp-buffer that register via after/plugin/ scripts. Added explicit
   source_plugin_files() to handle this for both lazy and startup paths.

3. Single dependency specs silently losing fields: normalize_dependencies
   treated { "user/repo", opts = {} } as a string list, dropping hash
   keys like opts, init, config via ipairs. Fixed is_single_spec to
   detect non-integer keys, so single specs with options are preserved.
@zuqini zuqini merged commit a782b9d into main Apr 8, 2026
2 checks passed
@zuqini zuqini deleted the zuqini/lazy-loading-bug branch April 8, 2026 19:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant