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

lib/keymaps: remove lua attr in type's merge fn #2342

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MattSturgeon
Copy link
Member

@MattSturgeon MattSturgeon commented Sep 29, 2024

Rather than having each option remove lua in their apply function, we can do this in the submodule type's merge function.

Yes, it's a little annoying that we have to indent the submodule definition in order to override it's merge attr.

EDIT: even more annoying that we get used but not defined errors... drafting for now

error: The option `keymaps."[definition 1-entry 1]".lua' was accessed but has no value defined. Try setting the option.

Rather than having each option remove `lua` in their `apply` function,
we can do this in the submodule type's `merge` function.
@MattSturgeon MattSturgeon marked this pull request as draft September 29, 2024 20:01
@MattSturgeon
Copy link
Member Author

Testing in the repl:

With lib.modules.mergeDefinitions and/or the type's merge function, using lib.nixvim.keymaps.deprecatedMapOptionSubmodule seems to work, but using options..keymaps.type.nestedTypes.elemType does not.

I don't understand, because these two should be the same thing...

This feels like the same weirdness that we ran into when trying to override types.coercedTo for use in transitionType.

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.

1 participant