Skip to content

Commit

Permalink
Statusline indicator to show number of selected chars
Browse files Browse the repository at this point in the history
Feature request: #4624
  • Loading branch information
wes adams committed Nov 9, 2022
1 parent 758bace commit 66872b7
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion helix-term/src/ui/statusline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,15 @@ where
F: Fn(&mut RenderContext, String, Option<Style>) + Copy,
{
let count = context.doc.selection(context.view.id).len();
let tot_sel = context.doc.selections().
get(&context.view.id).
unwrap().
ranges()[0].
len();
write(
context,
format!(" {} sel{} ", count, if count == 1 { "" } else { "s" }),
format!(" {} sel{} {}",
count, if count == 1 { "" } else { "s" }, tot_sel),
None,
);
}
Expand Down

0 comments on commit 66872b7

Please sign in to comment.