nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit e247be69bfaa6975713d8d9dc84973b243d2e34a
parent e2096868355341b8dcfc1a80f3a1ce680e951d69
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Tue, 10 Mar 2020 10:30:07 +0100

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.

Diffstat:
Msrc/text.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 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. */