From 8b2a14153b0d21391e06636d0df7e8cc1b8143c4 Mon Sep 17 00:00:00 2001 From: Alexis Kalabura Date: Thu, 21 Jul 2022 00:03:12 -0400 Subject: add statusline element to display file line endings (#3113) * add statusline element to display file line endings * run cargo fmt --all * change the word *ending* from plural to singular * support for the unicode-lines feature flag--- helix-term/src/ui/statusline.rs | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'helix-term/src/ui') diff --git a/helix-term/src/ui/statusline.rs b/helix-term/src/ui/statusline.rs index 895043cd..85992c60 100644 --- a/helix-term/src/ui/statusline.rs +++ b/helix-term/src/ui/statusline.rs @@ -138,6 +138,7 @@ where helix_view::editor::StatusLineElement::Spinner => render_lsp_spinner, helix_view::editor::StatusLineElement::FileName => render_file_name, helix_view::editor::StatusLineElement::FileEncoding => render_file_encoding, + helix_view::editor::StatusLineElement::FileLineEnding => render_file_line_ending, helix_view::editor::StatusLineElement::FileType => render_file_type, helix_view::editor::StatusLineElement::Diagnostics => render_diagnostics, helix_view::editor::StatusLineElement::Selections => render_selections, @@ -280,6 +281,31 @@ where } } +fn render_file_line_ending(context: &mut RenderContext, write: F) +where + F: Fn(&mut RenderContext, String, Option