fix(configs): prevent plugin-level setup() from overriding user configuration#300
Closed
pirey wants to merge 1 commit into
Closed
fix(configs): prevent plugin-level setup() from overriding user configuration#300pirey wants to merge 1 commit into
pirey wants to merge 1 commit into
Conversation
…guration The plugin automatically calls setup() in @plugin/gitlinker.lua without arguments. If users also call setup() with custom router configs in their Neovim config, the plugin-level call runs AFTER and overwrites the user's configuration. Fix by adding early return in configs.setup() if Configs is already initialized.
Owner
|
Thank you The solution looks good, I haven't done any investigation about confliction between these two plugin initialization methods:
The detection on "Configs._route" variable should work, I think it means "whehter this plugin is been alreay initialized". Personally, I prefer using a boolean varaible to indicate whether this plugin is been initialized. Instead of using the "Configs._route" variable. For example, we can have two methods:
|
16 tasks
Owner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix #299
The plugin automatically calls setup() in @plugin/gitlinker.lua without arguments. If users also call setup() with custom router configs in their Neovim config, the plugin-level call runs AFTER and overwrites the user's configuration.
Fix by adding early return in configs.setup() if Configs is already initialized.
Test Platforms
Test Hosts
Test Functions
GitLink(!)to copy git link (or open in browser).GitLink(!) blameto copy the/blamelink (or open in browser).GitLink(!) default_branchto open the/main//masterlink in browser (or open in browser).GitLink(!) current_branchto open the current branch link in browser (or open in browser).