From 6866ea0d0e0a8650a21199347b2da072508ca1d6 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Mon, 23 Mar 2020 11:00:17 +0100 Subject: [PATCH] justify: skip over in-line whitespace only, not over leading whitespace This fixes https://savannah.gnu.org/bugs/?58028. Bug existed since commit 107abd26 from yesterday. --- src/text.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/text.c b/src/text.c index b62941e3..9137c8f7 100644 --- a/src/text.c +++ b/src/text.c @@ -1772,8 +1772,8 @@ 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])) + /* When not at the left edge, advance over blanks after the region. */ + while (end_x > 0 && is_blank_char(&endline->data[end_x])) end_x = step_right(endline->data, end_x); sampleline = startline;