Skip to content

Commit c796a25

Browse files
authored
Increase --list maximum alignable width from 30 to 50 (#2039)
1 parent e2c9405 commit c796a25

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/subcommand.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -427,6 +427,8 @@ impl Subcommand {
427427
}
428428

429429
fn list(config: &Config, level: usize, justfile: &Justfile) {
430+
const MAX_WIDTH: usize = 50;
431+
430432
// Construct a target to alias map.
431433
let mut recipe_aliases: BTreeMap<&str, Vec<&str>> = BTreeMap::new();
432434
if !config.no_aliases {
@@ -460,13 +462,13 @@ impl Subcommand {
460462
);
461463
}
462464

463-
if line_width <= 30 {
465+
if line_width <= MAX_WIDTH {
464466
line_widths.insert(name, line_width);
465467
}
466468
}
467469
}
468470

469-
let max_line_width = cmp::min(line_widths.values().copied().max().unwrap_or(0), 30);
471+
let max_line_width = cmp::min(line_widths.values().copied().max().unwrap_or(0), MAX_WIDTH);
470472
let doc_color = config.color.stdout().doc();
471473

472474
if level == 0 {

tests/misc.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -902,7 +902,7 @@ x a b='B ' c='C':
902902
echo {{a}} {{b}} {{c}}
903903
904904
# something else
905-
this-recipe-is-very-very-very-important Z="\t z":
905+
this-recipe-is-very-very-very-very-very-very-very-very-important Z="\t z":
906906
907907
# this recipe will not appear
908908
_private-recipe:
@@ -911,7 +911,7 @@ _private-recipe:
911911
stdout: r#"
912912
Available recipes:
913913
hello a b='B ' c='C' # this does a thing
914-
this-recipe-is-very-very-very-important Z="\t z" # something else
914+
this-recipe-is-very-very-very-very-very-very-very-very-important Z="\t z" # something else
915915
x a b='B ' c='C' # this does another thing
916916
"#,
917917
}

0 commit comments

Comments
 (0)