Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 3 additions & 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 Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ lsp-harness = { version = "0.1.0", path = "./lsp/lsp-harness" }
# building) but flake.nix needs to be kept in sync.
wasm-bindgen = "=0.2.100"

ansi_term = "0.12"
anstyle = "1.0.13"
anyhow = "1.0.97"
assert_cmd = "2.0.11"
assert_matches = "1.5.0"
Expand Down
4 changes: 2 additions & 2 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ bench = false
default = ["markdown", "repl", "doc", "format"]
clap = ["dep:clap"]
markdown = ["dep:termimad"]
repl = ["dep:rustyline", "dep:rustyline-derive", "dep:ansi_term"]
repl = ["dep:rustyline", "dep:rustyline-derive", "dep:anstyle"]
repl-wasm = ["dep:wasm-bindgen", "dep:js-sys", "dep:serde_repr", "dep:serde-wasm-bindgen"]
doc = ["dep:comrak"]
format = ["dep:topiary-core", "dep:topiary-queries", "dep:tree-sitter-nickel"]
Expand Down Expand Up @@ -63,7 +63,7 @@ unicode-segmentation.workspace = true
indoc.workspace = true

termimad = { workspace = true, optional = true }
ansi_term = { workspace = true, optional = true }
anstyle = { workspace = true, optional = true }

rustyline = { workspace = true, optional = true}
rustyline-derive = { workspace = true, optional = true }
Expand Down
6 changes: 3 additions & 3 deletions core/src/repl/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ use crate::{
term::Term,
};
#[cfg(feature = "repl")]
use ansi_term::{Colour, Style};
use anstyle::{AnsiColor, Style};
#[cfg(feature = "repl")]
use rustyline::validate::{ValidationContext, ValidationResult};

Expand Down Expand Up @@ -375,8 +375,8 @@ impl rustyline::highlight::Highlighter for InputParser {
prompt: &'p str,
_default: bool,
) -> std::borrow::Cow<'b, str> {
let style = Style::new().fg(Colour::Green);
std::borrow::Cow::Owned(style.paint(prompt).to_string())
let style = Style::new().fg_color(Some(AnsiColor::Green.into()));
std::borrow::Cow::Owned(format!("{style}{prompt}"))
}
}

Expand Down
6 changes: 3 additions & 3 deletions core/src/repl/rustyline_frontend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ use super::{command::Command, *};

use crate::{error::report::ColorOpt, eval::cache::CacheImpl};

use ansi_term::Style;
use anstyle::Style;
use rustyline::{error::ReadlineError, Config, EditMode, Editor};

/// The config of rustyline's editor.
Expand Down Expand Up @@ -116,7 +116,7 @@ pub fn repl(histfile: Option<PathBuf>, color_opt: ColorOpt) -> Result<(), InitEr
Ok(())
}
Ok(Command::Exit) => {
println!("{}", Style::new().bold().paint("Exiting"));
println!("{}Exiting", Style::new().bold());
break Ok(());
}
Err(err) => Err(Error::from(err)),
Expand All @@ -136,7 +136,7 @@ pub fn repl(histfile: Option<PathBuf>, color_opt: ColorOpt) -> Result<(), InitEr
};
}
Err(ReadlineError::Eof) => {
println!("{}", Style::new().bold().paint("Ctrl+D. Exiting"));
println!("{}Ctrl+D. Exiting", Style::new().bold());
break Ok(());
}
Err(ReadlineError::Interrupted) => (),
Expand Down