Skip to content

Commit

Permalink
feat: add cursor info to statusbar
Browse files Browse the repository at this point in the history
  • Loading branch information
metiftikci committed Oct 25, 2023
1 parent a0a5760 commit 7930131
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/screen/print_statusbar.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::{
core::style::Style,
editor::Editor,
screen::Screen,
theme::{THEME_ONE as T, WHITE},
theme::{BLACK, THEME_ONE as T, WHITE},
};

impl Screen {
Expand Down Expand Up @@ -57,5 +57,14 @@ impl Screen {
&format!("{}", mode),
Style::new(fg, bg),
);

let cursor_info = format!(" {}x{} ", buffer.cursor.x + 1, buffer.cursor.y + 1);

self.print_text(
editor.status_area.y,
editor.status_area.x + editor.status_area.width - (cursor_info.len() as u16) - 1,
&cursor_info,
Style::new(BLACK, T.status_line_bg),
);
}
}

0 comments on commit 7930131

Please sign in to comment.