nano

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

commit abcdd6605cb8bdcca293024012a01d3f50fdd1e9
parent f2d89cb3bcb15a95d550c3f1c5e7e2b84f649f3f
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Thu,  5 Mar 2020 18:57:03 +0100

tweaks: reshuffle a condition, for compacter code

Diffstat:
Msrc/text.c | 14++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/text.c b/src/text.c @@ -2129,14 +2129,12 @@ void do_justify(bool full_justify) add_undo(COUPLE_END, "justification"); - /* If we justified marked text, restore mark or cursor position. */ - if (openfile->mark) { - if (!right_side_up) { - openfile->mark = openfile->current; - openfile->mark_x = openfile->current_x; - openfile->current = line_from_number(was_top_lineno); - openfile->current_x = was_top_x; - } + /* After justifying a backward-marked text, swap mark and cursor. */ + if (openfile->mark && !right_side_up) { + openfile->mark = openfile->current; + openfile->mark_x = openfile->current_x; + openfile->current = line_from_number(was_top_lineno); + openfile->current_x = was_top_x; update_undo(COUPLE_END); } #endif