feat: redesign status chrome and floating prompts
This commit is contained in:
+26
-3
@@ -10,6 +10,7 @@ const DEFAULT_BOTTOM_SEGMENTS: &[&str] = &[
|
||||
"selections",
|
||||
"count",
|
||||
"language",
|
||||
"lsp",
|
||||
"position",
|
||||
];
|
||||
|
||||
@@ -57,12 +58,12 @@ impl ChromeLine {
|
||||
|
||||
pub fn bottom() -> Self {
|
||||
Self {
|
||||
left: DEFAULT_BOTTOM_SEGMENTS[..DEFAULT_BOTTOM_SEGMENTS.len() - 1]
|
||||
left: DEFAULT_BOTTOM_SEGMENTS[..DEFAULT_BOTTOM_SEGMENTS.len() - 3]
|
||||
.iter()
|
||||
.map(|name| (*name).into())
|
||||
.collect(),
|
||||
center: Vec::new(),
|
||||
right: vec!["position".into()],
|
||||
right: vec!["language".into(), "lsp".into(), "position".into()],
|
||||
segments: DEFAULT_BOTTOM_SEGMENTS
|
||||
.iter()
|
||||
.map(|name| ((*name).into(), default_segment(name)))
|
||||
@@ -267,6 +268,27 @@ mod tests {
|
||||
bottom: ChromeLine,
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn bottom_keeps_metadata_on_the_right_without_filled_styles() {
|
||||
let line = ChromeLine::bottom();
|
||||
assert_eq!(
|
||||
line.left,
|
||||
[
|
||||
"mode",
|
||||
"pending",
|
||||
"buffer",
|
||||
"diagnostics",
|
||||
"path",
|
||||
"selections",
|
||||
"count"
|
||||
]
|
||||
);
|
||||
assert_eq!(line.right, ["language", "lsp", "position"]);
|
||||
for name in ["language", "lsp"] {
|
||||
assert_eq!(line.segment(name), &SegmentConfig::default());
|
||||
}
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn omitted_options_inherit_and_explicit_groups_replace_defaults() {
|
||||
let lines: Lines = serde_json::from_value(serde_json::json!({
|
||||
@@ -277,7 +299,7 @@ mod tests {
|
||||
assert_eq!(lines.top.segment("tabs").leading_edge, "░▒▓");
|
||||
assert_eq!(lines.top.segment("battery").padding, 0);
|
||||
assert!(lines.bottom.left.is_empty());
|
||||
assert_eq!(lines.bottom.right, ["position"]);
|
||||
assert_eq!(lines.bottom.right, ["language", "lsp", "position"]);
|
||||
assert_eq!(lines.bottom.segment("workspace"), &SegmentConfig::default());
|
||||
}
|
||||
|
||||
@@ -293,6 +315,7 @@ mod tests {
|
||||
"selections",
|
||||
"count",
|
||||
"language",
|
||||
"lsp",
|
||||
"position",
|
||||
"battery",
|
||||
"workspace",
|
||||
|
||||
Reference in New Issue
Block a user