Skip to content

Commit

Permalink
fix empty description
Browse files Browse the repository at this point in the history
  • Loading branch information
maxomatic458 committed Jan 7, 2024
1 parent e6a2f1f commit ddb6aae
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/menu/ide_menu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -373,6 +373,10 @@ impl IdeMenu {
use_ansi_coloring: bool,
available_lines: u16,
) -> Vec<String> {
if description.is_empty() {
return Vec::new();
}

Check warning on line 378 in src/menu/ide_menu.rs

View check run for this annotation

Codecov / codecov/patch

src/menu/ide_menu.rs#L370-L378

Added lines #L370 - L378 were not covered by tests

let border_width = if self.default_details.border.is_some() {
2

Check warning on line 381 in src/menu/ide_menu.rs

View check run for this annotation

Codecov / codecov/patch

src/menu/ide_menu.rs#L380-L381

Added lines #L380 - L381 were not covered by tests
} else {
Expand Down Expand Up @@ -406,7 +410,10 @@ impl IdeMenu {
let horizontal_border = border.horizontal.to_string().repeat(if needs_padding {
content_width

Check warning on line 411 in src/menu/ide_menu.rs

View check run for this annotation

Codecov / codecov/patch

src/menu/ide_menu.rs#L409-L411

Added lines #L409 - L411 were not covered by tests
} else {
description_lines[0].chars().count()
description_lines
.first()
.map(|line| line.chars().count())
.unwrap_or(0)

Check warning on line 416 in src/menu/ide_menu.rs

View check run for this annotation

Codecov / codecov/patch

src/menu/ide_menu.rs#L413-L416

Added lines #L413 - L416 were not covered by tests
});

for line in &mut description_lines {
Expand Down

0 comments on commit ddb6aae

Please sign in to comment.