wip: slowly remembering where i was
Some checks failed
/ build (push) Has been cancelled

This commit is contained in:
🪞👃🪞 2025-06-13 11:42:20 +03:00
parent 17506726cb
commit c8827b43c3
9 changed files with 114 additions and 135 deletions

View file

@ -1,14 +1,12 @@
use crate::*;
#[test] fn test_subcommand () -> Usually<()> {
use crate::input::{Command, Handle, handle};
//use crate::dsl::TokenIter;
use crate::tui::TuiIn;
use crossterm::event::{Event, KeyEvent, KeyCode, KeyModifiers, KeyEventKind, KeyEventState};
//use crate::input::*;
//use crate::dsl::*;
use crate::input::*;
use crate::dsl::*;
struct Test {
//keys: InputMap<'static, Test, TestCommand, TuiIn, TokenIter<'static>>
keys: InputLayers
}
handle!(TuiIn: |self: Test, input|if let Some(command) = self.keys.command(self, input) {
Ok(Some(true))
@ -37,12 +35,12 @@ use crate::*;
}
}
let mut test = Test {
keys: InputMap::new("
keys: InputLayers::new(SourceIter::new("
(@a do-thing)
(@b do-thing-arg 0)
(@c do-sub do-other-thing)
(@d do-sub do-other-thing-arg 0)
".into())
".into()))
};
assert_eq!(Some(true), test.handle(&TuiIn(Default::default(), Event::Key(KeyEvent {
kind: KeyEventKind::Press,