Unnamed repository; edit this file 'description' to name the repository.
minor: Remove redundant condition in shell pipe trimming
`output.ends_with('\n')` implies `!output.is_empty()` Connects #11183
Michael Davis 2024-12-22
parent ac4c017 · commit 4f63a46
-rw-r--r--helix-term/src/commands.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/helix-term/src/commands.rs b/helix-term/src/commands.rs
index ed058f89..04e39e5e 100644
--- a/helix-term/src/commands.rs
+++ b/helix-term/src/commands.rs
@@ -6029,7 +6029,7 @@ fn shell(cx: &mut compositor::Context, cmd: &str, behavior: &ShellBehavior) {
let input = range.slice(text);
match shell_impl(shell, cmd, pipe.then(|| input.into())) {
Ok(mut output) => {
- if !input.ends_with("\n") && !output.is_empty() && output.ends_with('\n') {
+ if !input.ends_with("\n") && output.ends_with('\n') {
output.pop();
if output.ends_with('\r') {
output.pop();