From 8ef025a65dca7462d7738f76ba4088db35a247b8 Mon Sep 17 00:00:00 2001 From: PizzasBear <43722034+PizzasBear@users.noreply.github.com> Date: Sat, 16 Sep 2023 09:08:45 +0300 Subject: [PATCH] FIX: preserve_empty_first_line ignored Making `preserve_empty_first_line` argument affect naked CRLF first line. --- src/unindent.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/unindent.rs b/src/unindent.rs index 5331154..ca7d4db 100644 --- a/src/unindent.rs +++ b/src/unindent.rs @@ -22,7 +22,7 @@ fn do_unindent_bytes(s: &[u8], preserve_empty_first_line: bool) -> Vec { // Document may start either on the same line as opening quote or // on the next line let ignore_first_line = - !preserve_empty_first_line && s.starts_with(b"\n") || s.starts_with(b"\r\n"); + !preserve_empty_first_line && (s.starts_with(b"\n") || s.starts_with(b"\r\n")); // Largest number of spaces that can be removed from every // non-whitespace-only line after the first