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

plugins/flash: switch to mkNeovimPlugin #1714

Merged
merged 1 commit into from
Jul 1, 2024

Conversation

MattSturgeon
Copy link
Collaborator

@MattSturgeon MattSturgeon commented Jun 17, 2024

Prompted by changes in #1674, I've gone ahead and updated https://github.com/folke/flash.nvim to use mkNeovimPlugin and rfc42 settings.

The "modes" use the same options as top-level settings, so I've maintained a similar system to the existing implementation where mkModeOption combines all the common settings with any extras.

Rather than documenting mode-specific defaults in the option itself, I pass the defaults through to the sub-options themselves. This makes the docs slightly more accurate.

The search.automatic option is removed. If my interpretation of upstream's docs is correct it was never needed?

Comment on lines +23 to +27
merged = flatten [
opts
(mapAttrsToList (mode: extras: map (opt: "${mode}.${opt}") (opts ++ extras)) modes)
];
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why do you have those variables "out of order" ? I would personally prefer an "imperative-friendly" way.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Could you clarify what you mean? Do you mean having merged declared before opts?

I did that to make it obvious up front what the goal of the let block is, rather than having rather large attr sets/lists being the first thing you see.

Happy to change and/or remedy with comments.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, I meant

a = ...
b = f(a)
c = f(b)
d = f(a, c)
...

I find it more readable. Otherwise you are wondering what these opts are. But this is personal preference of course.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I find it more readable. Otherwise you are wondering what these opts are. But this is personal preference of course.

Generally, I agree. It was only the size of the other variable definitions that changed my mind this time.

I think because the opts is right there on the next line it is ok (this time)?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes sure, either way is fine. We should stop nit picking (I am looking at myself).

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes sure, either way is fine. We should stop nit picking (I am looking at myself).

Nothing wrong with being thorough and discussing the best approach in nuanced cases.

Maybe avoid nit-picking new contributes if it is likely to put them off contributing, but that doesn't mean let sloppy code in 😃

Comment on lines 103 to 109
# TODO: check automatic search config still works
(mkRemovedOptionModule [
"plugins"
"flash"
"search"
"automatic"
] "You can configure `plugins.flash.settings.search.*` directly.")
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@traxys am I missing anything with this option?

You had it set-up to assign helpers.emptyTable when search.automatic = true, but isn't that just explicitly enabling the default behaviour?

Copy link
Member

Choose a reason for hiding this comment

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

I'm not very familiar with the plugin, I don't remembrer

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I'm also not too familiar, so just trying to interpret the docs.

I think we can go with this and just hope if there's any issues they get reported.

@GaetanLepage
Copy link
Collaborator

Is this blocked by anything ?

@MattSturgeon
Copy link
Collaborator Author

Is this blocked by anything ?

No, don't think so

Comment on lines +457 to +458
# Not sure what the type is...
# Think it's listOf (maybeRaw (listOf (maybeRaw str)))?
Copy link
Collaborator

Choose a reason for hiding this comment

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

This needs to be solved.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

The comment is not mine, it is already present in main.

Same as #1714 (comment), I think I'd have to play with actually using/configuring the plugin to understand to correct solution.

The current type will at least allow users who know how to configure the plugin to do so, though they won't get build-time type checking.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, I didn't pay attention.

Copy link
Collaborator

@GaetanLepage GaetanLepage left a comment

Choose a reason for hiding this comment

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

LGTM

@MattSturgeon
Copy link
Collaborator Author

@Mergifyio queue

Copy link
Contributor

mergify bot commented Jul 1, 2024

queue

✅ The pull request has been merged automatically

The pull request has been merged automatically at aaab869

@mergify mergify bot merged commit aaab869 into nix-community:main Jul 1, 2024
57 checks passed
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.

None yet

3 participants