add nu-ansi-term (#3089)

This commit is contained in:
Darren Schroeder
2021-02-22 12:33:34 -06:00
committed by GitHub
parent 803826cdcd
commit 2c89a228d5
40 changed files with 2510 additions and 46 deletions

View File

@ -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);
}

View File

@ -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() {

View File

@ -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;