Skip to content

feat(new config option): load_order#27

Merged
stevearc merged 11 commits intostevearc:masterfrom
Zeioth:master
Sep 11, 2023
Merged

feat(new config option): load_order#27
stevearc merged 11 commits intostevearc:masterfrom
Zeioth:master

Conversation

@Zeioth
Copy link
Copy Markdown
Contributor

@Zeioth Zeioth commented Sep 10, 2023

New config options

-- list order ["modification_time", "creation_time", "filename"]
load_order = "modification_time",

Comments

These options allow modifying almost anything UX related, and should satisfy the needs of most users without adding excessive complexity.

This is just a proposal and I'm open to changes. If this is not part of your future vision for the project and you prefer to reject it, that's ok too. In any case, let me know.

Once more, thank you for creating another awesome piece of open source software 🫂

Update

I've cleaned the PR to ship only the load_order option. So it should be safe to merge now.

Copy link
Copy Markdown
Owner

@stevearc stevearc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the sorting change; I think that's relatively small but also a nice value add.

For formatting, I try to avoid implementations like this where there are a bunch of different config options to handle small stylistic preferences for end users. You end up building an entire config language almost like a mini-DSL, with increasingly complex code to support it. And someone always wants "just one more option" to configure things the way they want it. These days my preferred approach is to provide a default option, and then give the user a hook to do their own custom logic. In this case, that would mean allowing the user to pass their own format_item function in the config. That'll also require some small tweaks to the existing function, since we're loading the session data and referencing it from inside of the default format_item. We'll need to instead pass the data with the names to vim.ui.select so it's available to the custom format_item hooks.

@Zeioth Zeioth changed the title feat: UX config options (proposal) feat(new config option): load_order Sep 11, 2023
@Zeioth
Copy link
Copy Markdown
Contributor Author

Zeioth commented Sep 11, 2023

That makes sense. I've cleaned this PR to have load_order only 👍

@stevearc
Copy link
Copy Markdown
Owner

Looks good! Just fix the typecheck errors and it's good to merge

@stevearc
Copy link
Copy Markdown
Owner

Thanks!

@stevearc stevearc merged commit 6f13bd0 into stevearc:master Sep 11, 2023
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.

2 participants