minor: Remove redundant condition in shell pipe trimming

`output.ends_with('\n')` implies `!output.is_empty()`

Connects #11183
This commit is contained in:
Michael Davis 2024-12-22 09:40:49 -05:00
parent ac4c017165
commit 4f63a46e14
No known key found for this signature in database

View file

@ -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();