Skip to content

Commit

Permalink
Use owo-colors to highlight terminal output
Browse files Browse the repository at this point in the history
  • Loading branch information
mverzilli committed Oct 16, 2023
1 parent 464a931 commit f8dcf75
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 18 deletions.
13 changes: 1 addition & 12 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion tooling/debugger/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ nargo.workspace = true
noirc_printable_type.workspace = true
thiserror.workspace = true
easy-repl = "0.2.1"
colored = "2.0.4"
owo-colors = "3"
8 changes: 3 additions & 5 deletions tooling/debugger/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ use nargo::NargoError;

use nargo::ops::ForeignCallExecutor;

use thiserror::Error;

use easy_repl::{command, CommandStatus, Critical, Repl};
use std::cell::{Cell, RefCell};

use colored::Colorize;
use owo_colors::OwoColorize;

enum SolveResult {
Done,
Expand Down Expand Up @@ -81,7 +79,7 @@ impl<'backend, B: BlackBoxFunctionSolver> DebugContext<'backend, B> {
}

fn show_source_code_location(location: &OpcodeLocation, debug_artifact: &DebugArtifact) {
let locations = debug_artifact.debug_symbols[0].opcode_location(&location);
let locations = debug_artifact.debug_symbols[0].opcode_location(location);
if let Some(locations) = locations {
for loc in locations {
let file = &debug_artifact.file_map[&loc.file];
Expand All @@ -92,7 +90,7 @@ impl<'backend, B: BlackBoxFunctionSolver> DebugContext<'backend, B> {
println!(
"\n{}{}{}\n",
&source[0..start],
&source[start..end].reversed(),
&source[start..end].to_string().reversed(),
&source[end..]
);
}
Expand Down

0 comments on commit f8dcf75

Please sign in to comment.