mirror of
https://codeberg.org/unspeaker/tengri.git
synced 2026-08-07 14:16:56 +02:00
stylistic
This commit is contained in:
parent
33e135c614
commit
8970ae5d5d
1 changed files with 10 additions and 12 deletions
22
src/eval.rs
22
src/eval.rs
|
|
@ -221,7 +221,7 @@ pub fn eval_view <'a, O: Screen + 'a, S> (
|
|||
/// # Ok(()) }
|
||||
/// ```
|
||||
pub fn eval_view_tui <'a, S> (
|
||||
state: &S, output: &mut Tui, expr: impl Expression + 'a
|
||||
state: &S, to: &mut Tui, expr: impl Expression + 'a
|
||||
) -> Perhaps<XYWH<u16>> where
|
||||
S: Interpret<Tui, Option<XYWH<u16>>>
|
||||
+ for<'b>Namespace<'b, bool>
|
||||
|
|
@ -239,7 +239,7 @@ pub fn eval_view_tui <'a, S> (
|
|||
match frags.next() {
|
||||
Some("text") => {
|
||||
if let Some(src) = args?.src()? {
|
||||
output.show(src)
|
||||
to.show(src)
|
||||
} else {
|
||||
return Ok(None)
|
||||
}
|
||||
|
|
@ -248,11 +248,10 @@ pub fn eval_view_tui <'a, S> (
|
|||
Some("fg") => {
|
||||
let arg0 = arg0?.expect("fg: expected arg 0 (color)");
|
||||
if let Some(color) = Namespace::namespace(state, arg0)? {
|
||||
output.show(fg(color, thunk(move|output: &mut Tui|{
|
||||
state.interpret(output, &arg1)?;
|
||||
// FIXME?: don't max out the used area?
|
||||
Ok(Some(output.area().into()))
|
||||
})))
|
||||
fg(color, thunk(move|to: &mut Tui|{
|
||||
state.interpret(to, &arg1)?;
|
||||
Ok(Some(to.area().into())) // FIXME?: don't max out the used area?
|
||||
})).draw(to)
|
||||
} else {
|
||||
return Err(format!("fg: {arg0:?}: not a color").into())
|
||||
}
|
||||
|
|
@ -261,11 +260,10 @@ pub fn eval_view_tui <'a, S> (
|
|||
Some("bg") => {
|
||||
let arg0 = arg0?.expect("bg: expected arg 0 (color)");
|
||||
if let Some(color) = Namespace::namespace(state, arg0)? {
|
||||
output.show(bg(color, thunk(move|output: &mut Tui|{
|
||||
state.interpret(output, &arg1)?;
|
||||
// FIXME?: don't max out the used area?
|
||||
Ok(Some(output.area().into()))
|
||||
})))
|
||||
bg(color, thunk(move|to: &mut Tui|{
|
||||
state.interpret(to, &arg1)?;
|
||||
Ok(Some(to.area().into())) // FIXME?: don't max out the used area?
|
||||
})).draw(to)
|
||||
} else {
|
||||
return Err(format!("bg: {arg0:?}: not a color").into())
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue