Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'helix-term/src/ui/statusline.rs')
| -rw-r--r-- | helix-term/src/ui/statusline.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/helix-term/src/ui/statusline.rs b/helix-term/src/ui/statusline.rs index 4d4b9f2f..df23123c 100644 --- a/helix-term/src/ui/statusline.rs +++ b/helix-term/src/ui/statusline.rs @@ -332,10 +332,15 @@ fn render_selections<'a, F>(context: &mut RenderContext<'a>, write: F) where F: Fn(&mut RenderContext<'a>, Span<'a>) + Copy, { - let count = context.doc.selection(context.view.id).len(); + let selection = context.doc.selection(context.view.id); + let count = selection.len(); write( context, - format!(" {} sel{} ", count, if count == 1 { "" } else { "s" }).into(), + if count == 1 { + " 1 sel ".into() + } else { + format!(" {}/{count} sels ", selection.primary_index() + 1).into() + }, ); } |