Skip to content

Commit

Permalink
patchy: auto-merge pull request helix-editor#12326
Browse files Browse the repository at this point in the history
`patchy` is a tool which makes it easy to declaratively manage personal forks by automatically merging pull requests.

Check it out here: https://github.com/NikitaRevenco/patchy
  • Loading branch information
Rock Boynton committed Jan 2, 2025
2 parents 4817bfa + 20ab068 commit c5cadae
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion book/src/editor.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ The following statusline elements can be configured:
| `file-type` | The type of the opened file |
| `diagnostics` | The number of warnings and/or errors |
| `workspace-diagnostics` | The number of warnings and/or errors on workspace |
| `selections` | The number of active selections |
| `selections` | The primary selection index out of the number of active selections |
| `primary-selection-length` | The number of characters currently in primary selection |
| `position` | The cursor position |
| `position-percentage` | The cursor position as a percentage of the total number of lines |
Expand Down
10 changes: 8 additions & 2 deletions helix-term/src/ui/statusline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -305,10 +305,16 @@ fn render_selections<F>(context: &mut RenderContext, write: F)
where
F: Fn(&mut RenderContext, String, Option<Style>) + 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" }),
format!(
"{}/{} sel{} ",
selection.primary_index() + 1,
count,
if count == 1 { "" } else { "s" }
),
None,
);
}
Expand Down

0 comments on commit c5cadae

Please sign in to comment.