From 107abd26545addcc855cb2db3adae2dbef14a46c Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Sun, 22 Mar 2020 16:56:50 +0100 Subject: [PATCH] justify: skip over blanks after the region, to not skew the indentation This fixes https://savannah.gnu.org/bugs/?58023. Bug existed since commit 3225c71e from six days ago. --- src/text.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/text.c b/src/text.c index 8134d816..12e96585 100644 --- a/src/text.c +++ b/src/text.c @@ -1772,6 +1772,10 @@ void do_justify(bool full_justify) if (0 < end_x && end_x < fore_len) end_x = fore_len; + /* Advance over blanks after the region. */ + while (is_blank_char(&endline->data[end_x])) + end_x++; + sampleline = startline; /* Find the first line of the paragraph in which the region starts. */