view* -> understand*

This commit is contained in:
stop screaming 2026-02-21 18:21:56 +02:00
parent 4aef21f60d
commit 236ee6b810
4 changed files with 16 additions and 16 deletions

View file

@ -3362,16 +3362,16 @@ impl<T: MaybeHas<Track>> HasTrack for T {
impl Understand<TuiOut, ()> 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<TuiOut, ()> 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<TuiOut, ()> 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;
}