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 f890062
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion helix-term/src/ui/statusline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -247,9 +247,21 @@ 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 f890062

Please sign in to comment.