Skip to content
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

Remove unnecessary util load guard #132

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

Conversation

idbrii
Copy link
Contributor

@idbrii idbrii commented Aug 3, 2024

Fix Mundo_PluginLoaded is stored in sessions.

Autoload files don't need a load guard because vim only sources them when calling an autoload function that doesn't exist. Once util.vim is sourced, all of its functions are defined and it doesn't need to get called again.

If we kept the load guard, it should be called something like g:mundo_loaded_util so users with global in 'sessionoptions' (not the default) won't have the variable stored in their session. I think that would cause problems if you used a plugin manager to defer load mundo, loaded a session, and then loaded mundo. (plugin/mundo.vim calls mundo#util functions so util.vim is sourced on startup. Otherwise, this would be a more widespread problem.)

Test

  • :GundoRenderGraph, :MundoToggle

Fix Mundo_PluginLoaded is stored in sessions.

Autoload files don't need a load guard because vim only sources them
when calling an autoload function that doesn't exist. Once util.vim is
sourced, all of its functions are defined and it doesn't need to get
called again.

If we kept the load guard, it should be called something like
g:mundo_loaded_util so users with global in 'sessionoptions' (not the
default) won't have the variable stored in their session. I think that
would cause problems if you used a plugin manager to defer load mundo,
loaded a session, and then loaded mundo. (plugin/mundo.vim calls
mundo#util functions so util.vim is sourced on startup. Otherwise, this
would be a more widespread problem.)

Test
* :GundoRenderGraph, :MundoToggle
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.

None yet

1 participant