Skip to content

Commit

Permalink
indent current line nr
Browse files Browse the repository at this point in the history
  • Loading branch information
Kl4rry committed Jul 22, 2024
1 parent 535d99b commit ff54686
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions crates/ferrite-tui/src/widgets/editor_widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -127,13 +127,14 @@ impl StatefulWidget for EditorWidget<'_> {
.enumerate()
{
if line_nr {
let is_current_line = line_number == current_line_number;
let line_number_str = line_number.to_string();
let line_number_str = format!(
" {}{} ",
" ".repeat(line_number_max_width - line_number_str.len()),
" ".repeat(line_number_max_width - line_number_str.len() - is_current_line as usize),
line_number
);
let line_nr_theme = if line_number == current_line_number {
let line_nr_theme = if is_current_line {
convert_style(&theme.current_line_nr)
} else {
convert_style(&theme.line_nr)
Expand Down

0 comments on commit ff54686

Please sign in to comment.