refactor: Improve comfy_table usage and consistency
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -53,12 +53,13 @@ use crate::common::status::{MetaPluginInfo, CompressionInfo};
|
||||
|
||||
fn build_meta_plugin_table(meta_plugin_info: &std::collections::HashMap<String, MetaPluginInfo>) -> Table {
|
||||
let mut meta_plugin_table = Table::new();
|
||||
if std::io::stdout().is_terminal() {
|
||||
meta_plugin_table
|
||||
.load_preset(UTF8_FULL)
|
||||
.apply_modifier(UTF8_ROUND_CORNERS);
|
||||
} else {
|
||||
meta_plugin_table.set_content_arrangement(ContentArrangement::Dynamic);
|
||||
meta_plugin_table
|
||||
.load_preset(UTF8_FULL)
|
||||
.apply_modifier(UTF8_ROUND_CORNERS)
|
||||
.set_content_arrangement(ContentArrangement::Dynamic);
|
||||
|
||||
if !std::io::stdout().is_terminal() {
|
||||
meta_plugin_table.force_no_tty();
|
||||
}
|
||||
|
||||
meta_plugin_table.set_header(vec![
|
||||
@@ -121,12 +122,13 @@ fn build_meta_plugin_table(meta_plugin_info: &std::collections::HashMap<String,
|
||||
|
||||
fn build_compression_table(compression_info: &Vec<CompressionInfo>) -> Table {
|
||||
let mut compression_table = Table::new();
|
||||
if std::io::stdout().is_terminal() {
|
||||
compression_table
|
||||
.load_preset(UTF8_FULL)
|
||||
.apply_modifier(UTF8_ROUND_CORNERS);
|
||||
} else {
|
||||
compression_table.set_content_arrangement(ContentArrangement::Dynamic);
|
||||
compression_table
|
||||
.load_preset(UTF8_FULL)
|
||||
.apply_modifier(UTF8_ROUND_CORNERS)
|
||||
.set_content_arrangement(ContentArrangement::Dynamic);
|
||||
|
||||
if !std::io::stdout().is_terminal() {
|
||||
compression_table.force_no_tty();
|
||||
}
|
||||
|
||||
compression_table.set_header(vec![
|
||||
@@ -160,12 +162,13 @@ fn build_compression_table(compression_info: &Vec<CompressionInfo>) -> Table {
|
||||
|
||||
fn build_filter_plugin_table(filter_plugins: &Vec<crate::common::status::FilterPluginInfo>) -> Table {
|
||||
let mut filter_plugin_table = Table::new();
|
||||
if std::io::stdout().is_terminal() {
|
||||
filter_plugin_table
|
||||
.load_preset(UTF8_FULL)
|
||||
.apply_modifier(UTF8_ROUND_CORNERS);
|
||||
} else {
|
||||
filter_plugin_table.set_content_arrangement(ContentArrangement::Dynamic);
|
||||
filter_plugin_table
|
||||
.load_preset(UTF8_FULL)
|
||||
.apply_modifier(UTF8_ROUND_CORNERS)
|
||||
.set_content_arrangement(ContentArrangement::Dynamic);
|
||||
|
||||
if !std::io::stdout().is_terminal() {
|
||||
filter_plugin_table.force_no_tty();
|
||||
}
|
||||
|
||||
filter_plugin_table.set_header(vec![
|
||||
|
||||
Reference in New Issue
Block a user