Skip to content

Commit

Permalink
break in match cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Bram Hoendervangers committed Dec 20, 2021
1 parent 5961dd6 commit 31301e7
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions helix-term/src/compositor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,22 +142,21 @@ impl Compositor {
// propagate events through the layers until we either find a layer that consumes it or we
// run out of layers (event bubbling)
for layer in self.layers.iter_mut().rev() {
consumed = match layer.handle_event(event, cx) {
match layer.handle_event(event, cx) {
EventResult::Consumed(Some(callback)) => {
callbacks.push(callback);
true
consumed = true;
break;
}
EventResult::Consumed(None) => {
consumed = true;
break;
}
EventResult::Consumed(None) => true,
EventResult::Ignored(Some(callback)) => {
callbacks.push(callback);
false
}
EventResult::Ignored(None) => false,
EventResult::Ignored(None) => {}
};

if consumed {
break;
}
}

for callback in callbacks {
Expand Down

0 comments on commit 31301e7

Please sign in to comment.