listing: fix select modifier regression

Commit 61a0c3c27f ("listing: do not clear
selection after action") broke select/jump modifiers (e.g. prefixing a
jump with a number).

Signed-off-by: Manos Pitsidianakis <manos@pitsidianak.is>
pull/343/head
Manos Pitsidianakis 4 months ago
parent 81d1c0536b
commit 64e60cb0ee
No known key found for this signature in database
GPG Key ID: 7729C7707F7E09D0

@ -1940,9 +1940,28 @@ impl Component for Listing {
self.component.set_dirty(true);
return true;
}
_ => return false,
UIEvent::Input(Key::Esc) | UIEvent::Input(Key::Alt(''))
if !self.cmd_buf.is_empty() =>
{
self.cmd_buf.clear();
self.component.set_modifier_active(false);
context
.replies
.push_back(UIEvent::StatusEvent(StatusEvent::BufClear));
return true;
}
UIEvent::Input(Key::Char(c)) if c.is_ascii_digit() => {
self.cmd_buf.push(*c);
self.component.set_modifier_active(true);
context
.replies
.push_back(UIEvent::StatusEvent(StatusEvent::BufSet(
self.cmd_buf.clone(),
)));
return true;
}
_ => {}
}
return true;
}
} else if self.focus == ListingFocus::Menu {
match *event {

Loading…
Cancel
Save