mirror of
https://codeberg.org/unspeaker/tek.git
synced 2025-12-09 05:06:43 +01:00
This commit is contained in:
parent
71c519b711
commit
4fbd6ab408
3 changed files with 37 additions and 95 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue