mirror of
https://github.com/nushell/nushell.git
synced 2025-08-10 01:37:49 +02:00
add nu-ansi-term (#3089)
This commit is contained in:
@ -12,6 +12,7 @@ name = "table"
|
||||
path = "src/main.rs"
|
||||
|
||||
[dependencies]
|
||||
ansi_term = "0.12.1"
|
||||
nu-ansi-term = { version = "0.27.1", path = "../nu-ansi-term" }
|
||||
|
||||
regex = "1.4"
|
||||
unicode-width = "0.1.8"
|
||||
|
@ -25,7 +25,7 @@ fn main() {
|
||||
let table = Table::new(headers, vec![rows; 3], Theme::rounded());
|
||||
|
||||
// FIXME: Config isn't available from here so just put these here to compile
|
||||
let color_hm: HashMap<String, ansi_term::Style> = HashMap::new();
|
||||
let color_hm: HashMap<String, nu_ansi_term::Style> = HashMap::new();
|
||||
// Draw the table
|
||||
draw_table(&table, width, &color_hm);
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
use crate::wrap::{column_width, split_sublines, wrap, Alignment, Subline, WrappedCell};
|
||||
use ansi_term::{Color, Style};
|
||||
use nu_ansi_term::{Color, Style};
|
||||
use std::collections::HashMap;
|
||||
|
||||
enum SeparatorPosition {
|
||||
@ -867,7 +867,7 @@ impl WrappedTable {
|
||||
fn print_table(&self, color_hm: &HashMap<String, Style>) {
|
||||
#[cfg(windows)]
|
||||
{
|
||||
let _ = ansi_term::enable_ansi_support();
|
||||
let _ = nu_ansi_term::enable_ansi_support();
|
||||
}
|
||||
|
||||
if self.data.is_empty() {
|
||||
|
@ -1,5 +1,5 @@
|
||||
use crate::table::TextStyle;
|
||||
use ansi_term::Style;
|
||||
use nu_ansi_term::Style;
|
||||
use std::collections::HashMap;
|
||||
use std::{fmt::Display, iter::Iterator};
|
||||
use unicode_width::UnicodeWidthStr;
|
||||
|
Reference in New Issue
Block a user