Skip to content

fix(core): set init_done before sourcing after directories #2027

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

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.

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