From 4f63a46e14fea34a6bafd71af2bbdcd0106ce74d Mon Sep 17 00:00:00 2001 From: Michael Davis Date: Sun, 22 Dec 2024 09:40:49 -0500 Subject: [PATCH] minor: Remove redundant condition in shell pipe trimming `output.ends_with('\n')` implies `!output.is_empty()` Connects #11183 --- helix-term/src/commands.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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();