diff --git a/app/tek.rs b/app/tek.rs index d12d978e..a6348d46 100644 --- a/app/tek.rs +++ b/app/tek.rs @@ -1,16 +1,14 @@ #![allow(clippy::unit_arg)] -#![feature(adt_const_params, - associated_type_defaults, - closure_lifetime_binder, - if_let_guard, - impl_trait_in_assoc_type, - trait_alias, - type_alias_impl_trait, - type_changing_struct_update)] +#![feature( + adt_const_params, associated_type_defaults, closure_lifetime_binder, + impl_trait_in_assoc_type, trait_alias, type_alias_impl_trait, type_changing_struct_update +)] + mod tek_struct; pub use self::tek_struct::*; mod tek_trait; pub use self::tek_trait::*; mod tek_type; pub use self::tek_type::*; mod tek_impls; + extern crate xdg; pub(crate) use ::xdg::BaseDirectories; pub extern crate atomic_float; @@ -133,12 +131,14 @@ pub(crate) fn load_view (views: &Views, name: &impl AsRef, body: &impl Lang views.write().unwrap().insert(name.as_ref().into(), body.src()?.unwrap_or_default().into()); Ok(()) } + pub(crate) fn load_mode (modes: &Modes, name: &impl AsRef, body: &impl Language) -> Usually<()> { let mut mode = Mode::default(); body.each(|item|mode.add(item))?; modes.write().unwrap().insert(name.as_ref().into(), Arc::new(mode)); Ok(()) } + pub(crate) fn load_bind (binds: &Binds, name: &impl AsRef, body: &impl Language) -> Usually<()> { binds.write().unwrap().insert(name.as_ref().into(), Bind::load(body)?); Ok(()) diff --git a/app/tek_impls.rs b/app/tek_impls.rs index 28700271..c876e99e 100644 --- a/app/tek_impls.rs +++ b/app/tek_impls.rs @@ -3362,16 +3362,16 @@ impl> HasTrack for T { impl Understand for App { - fn view_expr <'a> (&'a self, to: &mut TuiOut, expr: &'a impl Expression) -> Usually<()> { + fn understand_expr <'a> (&'a self, to: &mut TuiOut, expr: &'a impl Expression) -> Usually<()> { if evaluate_output_expression(self, to, expr)? || evaluate_output_expression_tui(self, to, expr)? { Ok(()) } else { - Err(format!("App::view_expr: unexpected: {expr:?}").into()) + Err(format!("App::understand_expr: unexpected: {expr:?}").into()) } } - fn view_word <'a> (&'a self, to: &mut TuiOut, dsl: &'a impl Expression) -> Usually<()> { + fn understand_word <'a> (&'a self, to: &mut TuiOut, dsl: &'a impl Expression) -> Usually<()> { let mut frags = dsl.src()?.unwrap().split("/"); match frags.next() { Some(":logo") => to.place(&view_logo()), @@ -3412,7 +3412,7 @@ impl Understand for App { } else { None }), - _ => unimplemented!("App::view_word: {dsl:?} ({frags:?})"), + _ => unimplemented!("App::understand_word: {dsl:?} ({frags:?})"), }, Some(":templates") => to.place(&{ let modes = self.config.modes.clone(); @@ -3466,7 +3466,7 @@ impl Understand for App { if let Some(dsl) = views.get(dsl.src()?.unwrap()) { let dsl = dsl.clone(); std::mem::drop(views); - self.view(to, &dsl)? + self.understand(to, &dsl)? } else { unimplemented!("{dsl:?}"); } @@ -3815,7 +3815,7 @@ mod draw { to.place_at(to.area(), e); } for (_index, dsl) in self.mode.view.iter().enumerate() { - if let Err(e) = self.view(to, dsl) { + if let Err(e) = self.understand(to, dsl) { *self.error.write().unwrap() = Some(format!("{e}").into()); break; } diff --git a/dizzle b/dizzle index f6fb8c84..eec89565 160000 --- a/dizzle +++ b/dizzle @@ -1 +1 @@ -Subproject commit f6fb8c844a31b35f5739297272250ff9c7fee345 +Subproject commit eec89565c99eb23c2c46803de1bfaabbb6ef95b2 diff --git a/tengri b/tengri index b294f2e6..006cddcc 160000 --- a/tengri +++ b/tengri @@ -1 +1 @@ -Subproject commit b294f2e62b970cf4e1cb133346132a0a113af575 +Subproject commit 006cddcc16868aa626ecca6abf1c0f00523402fc