feat: add support for percentage-based max_len values
Co-authored-by: aider (openai/andrew/openrouter/deepseek/deepseek-chat-v3.1) <aider@aider.chat>
This commit is contained in:
@@ -12,7 +12,7 @@ pub struct ColumnConfig {
|
||||
#[serde(default)]
|
||||
pub align: ColumnAlignment,
|
||||
#[serde(default)]
|
||||
pub max_len: Option<usize>,
|
||||
pub max_len: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Debug, Clone, Serialize, Deserialize, Default)]
|
||||
@@ -35,7 +35,7 @@ impl<'de> serde::Deserialize<'de> for ColumnConfig {
|
||||
#[serde(default)]
|
||||
align: ColumnAlignment,
|
||||
#[serde(default)]
|
||||
max_len: Option<usize>,
|
||||
max_len: Option<String>,
|
||||
}
|
||||
|
||||
let helper = Helper::deserialize(deserializer)?;
|
||||
@@ -207,31 +207,31 @@ impl Settings {
|
||||
name: "id".to_string(),
|
||||
label: "id".to_string(),
|
||||
align: ColumnAlignment::Left,
|
||||
max_len: Some(8),
|
||||
max_len: Some("8".to_string()),
|
||||
},
|
||||
ColumnConfig {
|
||||
name: "time".to_string(),
|
||||
label: "time".to_string(),
|
||||
align: ColumnAlignment::Left,
|
||||
max_len: Some(19),
|
||||
max_len: Some("19".to_string()),
|
||||
},
|
||||
ColumnConfig {
|
||||
name: "size".to_string(),
|
||||
label: "size".to_string(),
|
||||
align: ColumnAlignment::Left,
|
||||
max_len: Some(10),
|
||||
max_len: Some("10".to_string()),
|
||||
},
|
||||
ColumnConfig {
|
||||
name: "tags".to_string(),
|
||||
label: "tags".to_string(),
|
||||
align: ColumnAlignment::Left,
|
||||
max_len: Some(20),
|
||||
max_len: Some("20".to_string()),
|
||||
},
|
||||
ColumnConfig {
|
||||
name: "meta:hostname".to_string(),
|
||||
label: "hostname".to_string(),
|
||||
align: ColumnAlignment::Left,
|
||||
max_len: Some(15),
|
||||
max_len: Some("15".to_string()),
|
||||
},
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user