Compare commits
5 Commits
d1053f687b
...
89a6f09a90
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
89a6f09a90 | ||
|
|
7c03656dfe | ||
|
|
6681cc3c69 | ||
|
|
6518fd4b30 | ||
|
|
78cc3647c7 |
@@ -102,7 +102,7 @@ fn handle_message(
|
|||||||
/// This is useful to ultimately create a `Control` without the user having to
|
/// This is useful to ultimately create a `Control` without the user having to
|
||||||
/// input all of the character(s) needed.
|
/// input all of the character(s) needed.
|
||||||
fn read_input(
|
fn read_input(
|
||||||
agent: Subject(Control),
|
subject: Subject(Control),
|
||||||
inject_input: Subject(Key),
|
inject_input: Subject(Key),
|
||||||
tap_input: Subject(List(String)),
|
tap_input: Subject(List(String)),
|
||||||
) -> Nil {
|
) -> Nil {
|
||||||
@@ -111,13 +111,10 @@ fn read_input(
|
|||||||
Ok(_) | Error(_) -> []
|
Ok(_) | Error(_) -> []
|
||||||
}
|
}
|
||||||
|
|
||||||
case
|
let _ =
|
||||||
key.read_input_until_key(buffer, tap_input)
|
key.read_input_until_key(buffer, tap_input)
|
||||||
|> control.from_key
|
|> control.from_key
|
||||||
{
|
|> result.map(process.send(subject, _))
|
||||||
Error(_) -> Nil
|
|
||||||
Ok(control) -> process.send(agent, control)
|
|
||||||
}
|
|
||||||
|
|
||||||
read_input(agent, inject_input, tap_input)
|
read_input(subject, inject_input, tap_input)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user