@@ -142,6 +142,9 @@ where
142142 helix_view::editor::StatusLineElement::FileType => render_file_type,
143143 helix_view::editor::StatusLineElement::Diagnostics => render_diagnostics,
144144 helix_view::editor::StatusLineElement::Selections => render_selections,
145+ helix_view::editor::StatusLineElement::PrimarySelectionLength => {
146+ render_primary_selection_length
147+ }
145148 helix_view::editor::StatusLineElement::Position => render_position,
146149 helix_view::editor::StatusLineElement::PositionPercentage => render_position_percentage,
147150 helix_view::editor::StatusLineElement::TotalLineNumbers => render_total_line_numbers,
@@ -254,6 +257,18 @@ where
254257 );
255258}
256259
260+fn render_primary_selection_length<F>(context: &mut RenderContext, write: F)
261+where
262+ F: Fn(&mut RenderContext, String, Option<Style>) + Copy,
263+{
264+ let tot_sel = context.doc.selection(context.view.id).primary().len();
265+ write(
266+ context,
267+ format!(" {} char{} ", tot_sel, if tot_sel == 1 { "" } else { "s" }),
268+ None,
269+ );
270+}
271+
257272fn get_position(context: &RenderContext) -> Position {
258273 coords_at_pos(
259274 context.doc.text().slice(..),