From 21742c496a72e96cfbcbb032a8c143bdc43e3056 Mon Sep 17 00:00:00 2001 From: wes adams Date: Wed, 9 Nov 2022 13:11:35 -0500 Subject: [PATCH] Statusline indicator to show number of selected chars Feature request: #4624 --- helix-term/src/ui/statusline.rs | 16 ++++++++++++++++ helix-view/src/editor.rs | 11 ++++++++++- 2 files changed, 26 insertions(+), 1 deletion(-) diff --git a/helix-term/src/ui/statusline.rs b/helix-term/src/ui/statusline.rs index b0e8ec5d2546e..180958a930275 100644 --- a/helix-term/src/ui/statusline.rs +++ b/helix-term/src/ui/statusline.rs @@ -142,6 +142,7 @@ where helix_view::editor::StatusLineElement::FileType => render_file_type, helix_view::editor::StatusLineElement::Diagnostics => render_diagnostics, helix_view::editor::StatusLineElement::Selections => render_selections, + helix_view::editor::StatusLineElement::TotalCharsSelected => render_total_chars_selected, helix_view::editor::StatusLineElement::Position => render_position, helix_view::editor::StatusLineElement::PositionPercentage => render_position_percentage, helix_view::editor::StatusLineElement::TotalLineNumbers => render_total_line_numbers, @@ -254,6 +255,21 @@ where ); } +fn render_total_chars_selected(context: &mut RenderContext, write: F) +where + F: Fn(&mut RenderContext, String, Option