forked from meli/meli
1
Fork 0

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>
master
Manos Pitsidianakis 2024-01-08 12:32:09 +02:00
parent 81d1c0536b
commit 64e60cb0ee
Signed by: Manos Pitsidianakis
GPG Key ID: 7729C7707F7E09D0
1 changed files with 21 additions and 2 deletions

View File

@ -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 {