handle extend shorten widget width event after component events

This commit is contained in:
Takayuki Maeda 2021-09-14 22:09:09 +09:00
parent fa3b32d6d2
commit 46e2f3081c

View File

@ -315,10 +315,6 @@ impl App {
return Ok(EventState::Consumed); return Ok(EventState::Consumed);
} }
if self.expand_or_shorten_widget_width(key)?.is_consumed() {
return Ok(EventState::Consumed);
};
match self.focus { match self.focus {
Focus::ConnectionList => { Focus::ConnectionList => {
if self.connections.event(key)?.is_consumed() { if self.connections.event(key)?.is_consumed() {
@ -439,10 +435,15 @@ impl App {
}; };
} }
} }
if self.extend_or_shorten_widget_width(key)?.is_consumed() {
return Ok(EventState::Consumed);
};
Ok(EventState::NotConsumed) Ok(EventState::NotConsumed)
} }
fn expand_or_shorten_widget_width(&mut self, key: Key) -> anyhow::Result<EventState> { fn extend_or_shorten_widget_width(&mut self, key: Key) -> anyhow::Result<EventState> {
if key if key
== self == self
.config .config