From c796a253af018a89182471afee833155455594af Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 14 May 2024 19:37:00 -0700 Subject: [PATCH] Increase --list maximum alignable width from 30 to 50 (#2039) --- src/subcommand.rs | 6 ++++-- tests/misc.rs | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) 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 "#, }