-
-
Notifications
You must be signed in to change notification settings - Fork 405
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
fix #565: setup data after config loaded #572
base: harpoon2
Are you sure you want to change the base?
Conversation
@rusnasonov thank you for the PR. What about leaving the data initialization and |
It's creates additional empty data file with default key, which will never be used. If it's ok - why not.
Ok |
This also fixes #577 |
@@ -146,6 +146,7 @@ function Harpoon.setup(self, partial_config) | |||
|
|||
---@diagnostic disable-next-line: param-type-mismatch | |||
self.config = Config.merge_config(partial_config, self.config) | |||
self.data = Data.Data:new(self.config) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Found this MR just before creating my pull request :) Looks like it takes time to get it merged.
One suggestion from me would be to check at least for the partial_config
to be non-empty. Otherwise we don't need to reload data and calling sync_on_change
(e.g. if it was just harpoon.setup({})).
self.data = Data.Data:new(self.config) | |
if partial_config then | |
self.data = Data.Data:new(self.config) | |
end |
(and the same if
before calling sync_on_change
).
No description provided.