Skip to content

Commit

Permalink
fix: update duplicates from children too
Browse files Browse the repository at this point in the history
  • Loading branch information
lavafroth committed Jul 22, 2024
1 parent 15ea1bf commit 0aa67ff
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,18 @@ impl SwhkdParser {
}
let child = Self::as_import(ParserInput::Path(Path::new(&import)), seen)?;
imports.extend(child.imports);
bindings.extend(child.bindings);

for binding in child.bindings {
if let Some(b) = bindings
.iter_mut()
.find(|b| b.definition == binding.definition)
{
b.command = binding.command;
b.mode_instructions = binding.mode_instructions;
} else {
bindings.push(binding);
}
}
unbinds.extend(child.unbinds);
modes.extend(child.modes);
}
Expand Down

0 comments on commit 0aa67ff

Please sign in to comment.