fix: compiles again
Some checks failed
/ build (push) Has been cancelled

This commit is contained in:
🪞👃🪞 2025-07-19 20:25:42 +03:00
parent 71c519b711
commit 4fbd6ab408
3 changed files with 37 additions and 95 deletions

View file

@ -7,10 +7,11 @@ macro_rules! cmd_todo { ($msg:literal) => {{ println!($msg); None }}; }
handle!(TuiIn: |self: App, input|self.handle_tui_key_with_history(input));
impl App {
fn handle_tui_key_with_history (&mut self, input: &TuiIn) -> Perhaps<bool> {
Ok(if let Some(command) = self.config.keys.handle(self, input)? {
// FIXME failed commands not persisted in undo history
let undo = command.clone().execute(self)?;
self.history.push((command, undo));
Ok(if let Some(binding) = self.config.keys.dispatch(input.event()) {
let binding = binding.clone();
let undo = binding.command.clone().execute(self)?;
// FIXME failed commands are not persisted in undo history
//self.history.push((binding.command.clone(), undo));
Some(true)
} else {
None