justify: restore a region properly when it was marked backwards

This fixes https://savannah.gnu.org/bugs/?57960.

Bug existed since version 4.8, commit e01651cd.
master
Benno Schulenberg 2020-03-05 18:42:14 +01:00
parent 2d05ce37c6
commit f2d89cb3bc
1 changed files with 3 additions and 4 deletions

View File

@ -2131,10 +2131,9 @@ void do_justify(bool full_justify)
/* If we justified marked text, restore mark or cursor position. */
if (openfile->mark) {
if (right_side_up) {
openfile->mark = line_from_number(was_top_lineno);
openfile->mark_x = was_top_x;
} else {
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;
}