tweaks: reshuffle a condition, for compacter code
parent
f2d89cb3bc
commit
abcdd6605c
14
src/text.c
14
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
|
||||
|
|
Loading…
Reference in New Issue