fix: correctly handle user config#9
Merged
JavaHello merged 1 commit intoJavaHello:masterfrom Sep 19, 2025
Merged
Conversation
Owner
|
Thanks |
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.
Currently, the
setup()function in config.lua reassigns the entire module tableMto a new table returned byvim.tbl_extend. As a result, any existing references to the originalM(such as the one returned when requiring the module) becomes stale. This causes inconsistent behavior where:require("java-deps.config")will result in the old values (ignoring any user supplied config).config.get_split_command()orconfig.has_numbers()) uses the new values (the ones from the user config).That is because they are operating on different tables.
a minimal example that showcases the issue:
This will output
To fix this, I merged the new configuration directly into the existing
Mtable. I also changedvim.tbl_extendtovim.tbl_deep_extendsince the config has nested tables. There are other ways to fix this, but I think this approach minimize changes to the current codebase.