From 2b70d27cdf3d2177da50400f2b6b6fd4562e232e Mon Sep 17 00:00:00 2001
From: Tyarel8 <98483313+Tyarel8@users.noreply.github.com>
Date: Tue, 5 Aug 2025 20:20:37 +0200
Subject: [PATCH] fix(help): don't trim example result beginning (#16353)
# Description
The `help` command, when printing the examples with results, trims the
first line and it appears unindented compared to the following lines.
- Before:
- After:
# User-Facing Changes
# Tests + Formatting
# After Submitting
---
crates/nu-engine/src/documentation.rs | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/crates/nu-engine/src/documentation.rs b/crates/nu-engine/src/documentation.rs
index 10a0fb42e6..365c6ba579 100644
--- a/crates/nu-engine/src/documentation.rs
+++ b/crates/nu-engine/src/documentation.rs
@@ -497,8 +497,9 @@ fn get_command_documentation(
long_desc,
" {}",
item.to_expanded_string("", nu_config)
+ .trim_end()
+ .trim_start_matches(|c: char| c.is_whitespace() && c != ' ')
.replace('\n', "\n ")
- .trim()
);
}
}