pull/10883/merge
godalming123 2025-05-09 18:44:48 +00:00 committed by GitHub
commit 7927121617
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 32 additions and 0 deletions

View File

@ -157,6 +157,8 @@ where
render_primary_selection_length
}
helix_view::editor::StatusLineElement::Position => render_position,
helix_view::editor::StatusLineElement::Row => render_row,
helix_view::editor::StatusLineElement::Col => render_col,
helix_view::editor::StatusLineElement::PositionPercentage => render_position_percentage,
helix_view::editor::StatusLineElement::TotalLineNumbers => render_total_line_numbers,
helix_view::editor::StatusLineElement::Separator => render_separator,
@ -390,6 +392,30 @@ where
);
}
fn render_row<F>(context: &mut RenderContext, write: F)
where
F: Fn(&mut RenderContext, String, Option<Style>) + Copy,
{
let position = get_position(context);
write(
context,
format!(" {} ", position.row + 1),
None,
);
}
fn render_col<F>(context: &mut RenderContext, write: F)
where
F: Fn(&mut RenderContext, String, Option<Style>) + Copy,
{
let position = get_position(context);
write(
context,
format!(" {} ", position.col + 1),
None,
);
}
fn render_total_line_numbers<F>(context: &mut RenderContext, write: F)
where
F: Fn(&mut RenderContext, String, Option<Style>) + Copy,

View File

@ -595,6 +595,12 @@ pub enum StatusLineElement {
/// The cursor position
Position,
/// The row that the cursor is at
Row,
/// The column that the cursor is at
Col,
/// The separator string
Separator,