diff options
Diffstat (limited to 'src/commands/discocaml.rs')
-rw-r--r-- | src/commands/discocaml.rs | 41 |
1 files changed, 26 insertions, 15 deletions
diff --git a/src/commands/discocaml.rs b/src/commands/discocaml.rs index 712a846..8451d82 100644 --- a/src/commands/discocaml.rs +++ b/src/commands/discocaml.rs @@ -274,7 +274,7 @@ where Ok(()) } DiscocamlResponse::Error(err) => { - let err = anyhow!("got an error from discocaml: `{}`", err); + let err = anyhow!("got an error from discocaml: `{}`", escape_code(&err)); respond_with_error(&err, send).await; Err(err) } @@ -353,8 +353,7 @@ async fn run_dot(dot: &str) -> Result<BString> { } fn escape_code(s: &str) -> String { - // TODO - s.to_string() + s.replace("`", "\\`") } fn expr_response_message( @@ -375,24 +374,36 @@ fn expr_response_message( .button(CreateButton::new(format!("discocaml-draw-tree/{}", rowid)).label("Draw Tree")) .button( CreateButton::new(format!("discocaml-step-cbv/{}", rowid)) - .label("Step (CBV)") - .disabled(!expr.has_redex), - ) - .button( - CreateButton::new(format!("discocaml-step-cbn/{}", rowid)) - .label("Step (CBN)") + .label("Step") .disabled(!expr.has_redex), ) .button( CreateButton::new(format!("discocaml-run-cbv/{}", rowid)) - .label("Run (CBV)") - .disabled(!expr.has_redex), - ) - .button( - CreateButton::new(format!("discocaml-run-cbn/{}", rowid)) - .label("Run (CBN)") + .label("Run") .disabled(!expr.has_redex), ) + /* + .button( + CreateButton::new(format!("discocaml-step-cbv/{}", rowid)) + .label("Step (CBV)") + .disabled(!expr.has_redex), + ) + .button( + CreateButton::new(format!("discocaml-step-cbn/{}", rowid)) + .label("Step (CBN)") + .disabled(!expr.has_redex), + ) + .button( + CreateButton::new(format!("discocaml-run-cbv/{}", rowid)) + .label("Run (CBV)") + .disabled(!expr.has_redex), + ) + .button( + CreateButton::new(format!("discocaml-run-cbn/{}", rowid)) + .label("Run (CBN)") + .disabled(!expr.has_redex), + ) + */ } pub async fn handle_command( |