commit 9d499c769bf172c0e7fdac4028a8a7649bec9f6c
parent dad2b5541e513fff53ef7e80229153600de0cdd8
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Tue, 10 Mar 2020 10:56:05 +0100
justify: do not take an empty line as template for first-line indentation
This fixes https://savannah.gnu.org/bugs/?57437.
Diffstat:
1 file changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/text.c b/src/text.c
@@ -1789,6 +1789,10 @@ void do_justify(bool full_justify)
while (sampleline->prev && inpar(sampleline) && !begpar(sampleline, 0))
sampleline = sampleline->prev;
+ /* Ignore lines that contain no text. */
+ while (sampleline->next && !inpar(sampleline))
+ sampleline = sampleline->next;
+
/* Store the leading part that is to be used for the new paragraph. */
quot_len = quote_length(sampleline->data);
lead_len = quot_len + indent_length(sampleline->data + quot_len);