Skip to content

Commit

Permalink
filename prop added
Browse files Browse the repository at this point in the history
  • Loading branch information
Kacperacy committed May 13, 2024
1 parent 042b11d commit 4b14d83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ pub struct App {
pub content: Vec<String>,
pub cursor_position: Position,
pub cursor_offset: Position,
pub opened_filename: String,
}

impl Default for App {
Expand All @@ -29,6 +30,7 @@ impl Default for App {
content: Vec::new(),
cursor_position: Position { x: 0, y: 0 },
cursor_offset: Position { x: 0, y: 0 },
opened_filename: String::new(),
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use crate::app::App;
pub fn render(app: &mut App, frame: &mut Frame) {
let content_lines: Vec<Line> = app.content.iter().map(|s| s.as_str().into()).collect();

let filename_status = Line::from(format!("Filename: TEST",))
let filename_status = Line::from(format!("Filename: {}", app.opened_filename))
.left_aligned()
.style(Style::default().bg(Color::Rgb(128, 192, 255)).bold());

Expand Down

0 comments on commit 4b14d83

Please sign in to comment.