Skip to content

Commit

Permalink
fix: add short-circuiting to key-history
Browse files Browse the repository at this point in the history
  • Loading branch information
jtroo authored Nov 11, 2023
1 parent 53c3462 commit eee2408
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions keyberon/src/action/switch.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,10 @@ fn evaluate_boolean(
.nth(hkc.how_far_back as usize)
.map(|kc| kc as u16 == hkc.key_code)
.unwrap_or(false);
if matches!((ret, current_op), (true, Or) | (false, And)) {
current_index = current_end_index;
continue;
}
}
OpCodeType::BooleanOp(operator) => {
let res = stack.push_back(OperatorAndEndIndex {
Expand Down

0 comments on commit eee2408

Please sign in to comment.