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

config file unsorted #37

Closed
Bananeweizen opened this issue Feb 5, 2023 · 2 comments
Closed

config file unsorted #37

Bananeweizen opened this issue Feb 5, 2023 · 2 comments
Labels
enhancement New feature or request

Comments

@Bananeweizen
Copy link

I just noticed that a recently saved copy of the autoconfig.lua (then renamed to config.lua) is sorted completely differently than the current one. There is no problem as such with that. But if you use the autoconfig as base for a (reduced) config, then comparing them with a 2 way diff tool becomes not nice.

As a developer my assumption would be that the settings are stored in a set like data structure, and in many other languages sets have no explicit sort order, and need to be sorted explicitly to create some stable order during serialization.

@chrisant996
Copy link
Owner

They're unsorted sets.

The issue isn't whether to sort -- it's how to define the sort order.

The order in my flexprompt_config.lua is based on what I consider to be a purposeful order. It is not alphabetical at all.

I guess I can go ahead and apply an alphabetical sort when writing flexprompt_autoconfig.lua, but at least for myself that wouldn't be beneficial. I'm not convinced that "sort the config" is really going to address the motivation behind the request. I think I would spend the time to make the change, and you'll still have the exact same problem. Unless the separate config file never has any organization applied to it. But then it's going to be hard to read and manage anyway, I would think.

Anyway, I'll go ahead and sort it. I just think the root problem might not be fully identified yet, and the proposal might not have the anticipated benefit.

@chrisant996 chrisant996 added the enhancement New feature or request label Feb 5, 2023
@Bananeweizen
Copy link
Author

Since I've created the config file by first copying the autoconfig file, any sort order would avoid that problem in the future for similar workflows. So to me your fix is perfectly fine. Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants