From e247be69bfaa6975713d8d9dc84973b243d2e34a Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Tue, 10 Mar 2020 10:30:07 +0100 Subject: [PATCH] justify: when the cursor is at the left edge, keep it there Only when the endpoint of the selection is actually IN a leading part, then it should be advanced to include the whole leading part, so that the succeeding paragraph will get the proper first-line indentation. --- src/text.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/text.c b/src/text.c index 2502e67c..a68ace54 100644 --- a/src/text.c +++ b/src/text.c @@ -1808,7 +1808,7 @@ void do_justify(bool full_justify) fore_length = quot_len + indent_length(endline->data + quot_len); /* When the region ends IN the lead, take the whole lead. */ - if (end_x < fore_length) + if (0 < end_x && end_x < fore_length) end_x = fore_length; /* Include preceding and subsequent whitespace into the marked region. */