aboutsummaryrefslogtreecommitdiff
path: root/helix-term
diff options
context:
space:
mode:
authorSeth Bromberger2022-07-26 23:47:22 +0000
committerGitHub2022-07-26 23:47:22 +0000
commit846a6b65c3d13f49b571beee2189d17b71c92e3f (patch)
treee338696d783cfcde5eea4ca458fa938730ef136d /helix-term
parent61856f1d64557a053f9160698ab8751bf01d76ab (diff)
add configurable / theme-able statusline separator string (#3175)
* add configurable separator element to statusline * themable separator * clippy fixes * changed default separator to │ * doc updates
Diffstat (limited to 'helix-term')
-rw-r--r--helix-term/src/ui/statusline.rs14
1 files changed, 14 insertions, 0 deletions
diff --git a/helix-term/src/ui/statusline.rs b/helix-term/src/ui/statusline.rs
index df6d4800..75e5dbd7 100644
--- a/helix-term/src/ui/statusline.rs
+++ b/helix-term/src/ui/statusline.rs
@@ -144,6 +144,7 @@ where
helix_view::editor::StatusLineElement::Selections => render_selections,
helix_view::editor::StatusLineElement::Position => render_position,
helix_view::editor::StatusLineElement::PositionPercentage => render_position_percentage,
+ helix_view::editor::StatusLineElement::Separator => render_separator,
helix_view::editor::StatusLineElement::Spacer => render_spacer,
}
}
@@ -353,6 +354,19 @@ where
write(context, title, None);
}
+fn render_separator<F>(context: &mut RenderContext, write: F)
+where
+ F: Fn(&mut RenderContext, String, Option<Style>) + Copy,
+{
+ let sep = &context.editor.config().statusline.separator;
+
+ write(
+ context,
+ sep.to_string(),
+ Some(context.editor.theme.get("ui.statusline.separator")),
+ );
+}
+
fn render_spacer<F>(context: &mut RenderContext, write: F)
where
F: Fn(&mut RenderContext, String, Option<Style>) + Copy,