Skip to content

Commit 02acee6

Browse files
jbichaByron
authored andcommitted
feat!: replace ansiterm with nu-ansi-term
nu-ansi-term is more popular and maintained
1 parent 7df0aa5 commit 02acee6

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

crosstermion/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ include = ["src/**/*", "LICENSE.md", "README.md", "CHANGELOG.md"]
1212
[features]
1313
default = []
1414

15-
color = ["ansiterm"]
15+
color = ["nu-ansi-term"]
1616

1717
input-async = ["futures-channel", "async-channel", "futures-lite", "futures-core" ]
1818
input-async-crossterm = ["crossterm/event-stream", "input-async"]
@@ -28,9 +28,9 @@ crossterm = { version = "0.27.0", optional = true, default-features = false, fea
2828
futures-channel = { version = "0.3.5", optional = true, default-features = false, features = ["std", "sink"] }
2929
futures-core = { version = "0.3.5", optional = true, default-features = false }
3030
futures-lite = { version = "2.1.0", optional = true }
31+
nu-ansi-term = { version = "0.50", optional = true, default-features = false }
3132
tui = { package = "ratatui", version = "0.26.0", optional = true, default-features = false }
3233
tui-react = { version = "^0.23.2", optional = true, default-features = false, path = "../tui-react" }
33-
ansiterm = { version = "0.12.2", optional = true, default-features = false }
3434
async-channel = { version = "2.1.1", optional = true }
3535

3636
[target."cfg(windows)".dependencies]

crosstermion/src/color.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
use std::borrow::Cow;
22
use std::ffi::OsStr;
33

4-
#[cfg(feature = "ansiterm")]
4+
#[cfg(feature = "nu-ansi-term")]
55
mod _impl {
6-
use ansiterm::{ANSIGenericString, Style};
6+
use nu_ansi_term::{AnsiGenericString, Style};
77

88
pub struct Brush {
99
may_paint: bool,
@@ -27,20 +27,20 @@ mod _impl {
2727
pub fn paint<'a, I, S: 'a + ToOwned + ?Sized>(
2828
&mut self,
2929
input: I,
30-
) -> ANSIGenericString<'a, S>
30+
) -> AnsiGenericString<'a, S>
3131
where
3232
I: Into<std::borrow::Cow<'a, S>>,
3333
<S as ToOwned>::Owned: std::fmt::Debug,
3434
{
3535
match (self.may_paint, self.style.as_ref().take()) {
3636
(true, Some(style)) => style.paint(input),
37-
(_, Some(_)) | (_, None) => ANSIGenericString::from(input),
37+
(_, Some(_)) | (_, None) => AnsiGenericString::from(input),
3838
}
3939
}
4040
}
4141
}
4242

43-
#[cfg(feature = "ansiterm")]
43+
#[cfg(feature = "nu-ansi-term")]
4444
pub use _impl::*;
4545

4646
/// Return true if we should colorize the output, based on [clicolors spec](https://bixense.com/clicolors/) and [no-color spec](https://no-color.org)

crosstermion/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ pub mod cursor;
1111
pub mod color;
1212

1313
// Reexports
14-
#[cfg(feature = "ansiterm")]
15-
pub use ansiterm as ansi_term;
14+
#[cfg(feature = "nu-ansi-term")]
15+
pub use nu_ansi_term;
1616
#[cfg(feature = "crossterm")]
1717
pub use crossterm;
1818
#[cfg(feature = "tui")]

0 commit comments

Comments
 (0)