tweaks: reshuffle a condition, for compacter code

This commit is contained in:
Benno Schulenberg 2020-03-05 18:57:03 +01:00
parent f2d89cb3bc
commit abcdd6605c
1 changed files with 6 additions and 8 deletions

View File

@ -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