fix file log key events leaking through

This commit is contained in:
Stephan Dilly 2022-01-30 19:41:14 +01:00
parent f2b09d39c6
commit ef78a3a8ba

View File

@ -443,30 +443,25 @@ impl Component for FileRevlogComponent {
Ok(EventState::Consumed)
},
);
}
let selection_changed =
if key == self.key_config.keys.move_up {
self.move_selection(ScrollType::Up)
} else if key == self.key_config.keys.move_down {
self.move_selection(ScrollType::Down)
} else if key == self.key_config.keys.shift_up
|| key == self.key_config.keys.home
{
self.move_selection(ScrollType::Home)
} else if key == self.key_config.keys.shift_down
|| key == self.key_config.keys.end
{
self.move_selection(ScrollType::End)
} else if key == self.key_config.keys.page_up {
self.move_selection(ScrollType::PageUp)
} else if key == self.key_config.keys.page_down {
self.move_selection(ScrollType::PageDown)
} else {
false
};
return Ok(selection_changed.into());
} else if key == self.key_config.keys.move_up {
self.move_selection(ScrollType::Up)
} else if key == self.key_config.keys.move_down {
self.move_selection(ScrollType::Down)
} else if key == self.key_config.keys.shift_up
|| key == self.key_config.keys.home
{
self.move_selection(ScrollType::Home)
} else if key == self.key_config.keys.shift_down
|| key == self.key_config.keys.end
{
self.move_selection(ScrollType::End)
} else if key == self.key_config.keys.page_up {
self.move_selection(ScrollType::PageUp)
} else if key == self.key_config.keys.page_down {
self.move_selection(ScrollType::PageDown)
} else {
false
};
}
return Ok(EventState::Consumed);