diff --git a/src/subcommand.rs b/src/subcommand.rs index 22102a5..7cf101e 100644 --- a/src/subcommand.rs +++ b/src/subcommand.rs @@ -427,6 +427,8 @@ impl Subcommand { } fn list(config: &Config, level: usize, justfile: &Justfile) { + const MAX_WIDTH: usize = 50; + // Construct a target to alias map. let mut recipe_aliases: BTreeMap<&str, Vec<&str>> = BTreeMap::new(); if !config.no_aliases { @@ -460,13 +462,13 @@ impl Subcommand { ); } - if line_width <= 30 { + if line_width <= MAX_WIDTH { line_widths.insert(name, line_width); } } } - let max_line_width = cmp::min(line_widths.values().copied().max().unwrap_or(0), 30); + let max_line_width = cmp::min(line_widths.values().copied().max().unwrap_or(0), MAX_WIDTH); let doc_color = config.color.stdout().doc(); if level == 0 { diff --git a/tests/misc.rs b/tests/misc.rs index 66db8ae..8b40183 100644 --- a/tests/misc.rs +++ b/tests/misc.rs @@ -902,7 +902,7 @@ x a b='B ' c='C': echo {{a}} {{b}} {{c}} # something else -this-recipe-is-very-very-very-important Z="\t z": +this-recipe-is-very-very-very-very-very-very-very-very-important Z="\t z": # this recipe will not appear _private-recipe: @@ -911,7 +911,7 @@ _private-recipe: stdout: r#" Available recipes: hello a b='B ' c='C' # this does a thing - this-recipe-is-very-very-very-important Z="\t z" # something else + this-recipe-is-very-very-very-very-very-very-very-very-important Z="\t z" # something else x a b='B ' c='C' # this does another thing "#, }