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

UseNewInterpField does not handle merge mode correctly #566

Closed
wismill opened this issue Dec 19, 2024 · 0 comments · Fixed by #593
Closed

UseNewInterpField does not handle merge mode correctly #566

wismill opened this issue Dec 19, 2024 · 0 comments · Fixed by #593
Labels
bug Indicates an unexpected problem or unintended behavior compile-keymap Indicates a need for improvements or additions to keymap compilation
Milestone

Comments

@wismill
Copy link
Member

wismill commented Dec 19, 2024

What I meant is the following:

static bool
UseNewInterpField(enum si_field field, SymInterpInfo *old, SymInterpInfo *new,
                  bool report, enum si_field *collide)
{
    if (!(old->defined & field))
        return true;

but, correctly for keys:

static bool
UseNewKeyField(enum key_field field, enum key_field old, enum key_field new,
               bool clobber, bool report, enum key_field *collide)
{
    if (!(old & field))
        return (new & field);

Example:

        interpret A {
            repeat = true;
        };
        interpret A {
            repeat = true;
        };
        augment interpret A {
            action = SetMods(mods=Mod1);
        };

Output:

	interpret A+AnyOfOrNone(all) {
		repeat= True;
		action= NoAction();
	};

Removing the second interpret produces the correct output:

	interpret A+AnyOfOrNone(all) {
		repeat= True;
		action= SetMods(modifiers=Mod1);
	};

Originally posted by @mahkoh in #565 (comment)

@wismill wismill added bug Indicates an unexpected problem or unintended behavior compile-keymap Indicates a need for improvements or additions to keymap compilation labels Dec 19, 2024
@wismill wismill added this to the 1.8.0 milestone Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Indicates an unexpected problem or unintended behavior compile-keymap Indicates a need for improvements or additions to keymap compilation
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant