Skip to content

Commit

Permalink
Fix body preview indentation
Browse files Browse the repository at this point in the history
  • Loading branch information
thmshmm authored Feb 16, 2024
1 parent 431d833 commit cd209fd
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/app/ui.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,14 @@ pub fn render(f: &mut Frame, app: &mut App) {

pub fn render_preview(f: &mut Frame, app: &mut App) {
let selected_task = app.tasks.get_selected().unwrap();
let display_text = format!(
"{}:\n{}",
selected_task.name.split(':').last().unwrap(),
selected_task.body
);
let area = centered_rect(70, 90, f.size());
let paragraph = Paragraph::new(display_text.as_str())
let paragraph = Paragraph::new(selected_task.body.as_str())
.alignment(Alignment::Left)
.wrap(Wrap { trim: true })
.style(Style::default())
.block(Block::default().borders(Borders::ALL).title("Preview"));
.block(Block::default().borders(Borders::ALL).title(format!(
"Preview: {}",
selected_task.name.split(':').last().unwrap()
)));

f.render_widget(Clear, area);
f.render_widget(paragraph, area);
Expand Down

0 comments on commit cd209fd

Please sign in to comment.