Skip to content

Conversation

joshw1013
Copy link

Summary

This PR fixes a timing issue where a plugin loaded during the after directory scan would have its own after directory skipped.

Description

This moves the init_done variable before the after directory is sourced. This fixes an issue when a plugin is sourced while the runtime path list is being looped to find all after directories. If init_done is not set, the code assumes that its own after directory will be sourced in this loop, however since it already started this is impossible.

Example Scenario

This fixes an error for me when cmp_luasnip loads, which in its after/plugin directory it calls
require("cmp"). This causes nvim-cmp and all of its dependencies to load, however none of these after directories would get sourced.

Copy link
Contributor

This PR is stale because it has been open 30 days with no activity.

@github-actions github-actions bot added the stale label Aug 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant