fixed wrong rectangular selection when selected from right to left
    and/or bottom to top

Signed-off-by: Ilia Maslakov <il.smind@gmail.com>
This commit is contained in:
Ilia Maslakov 2009-10-23 11:14:07 +00:00
parent 2111bfc05d
commit dc8c80c334

View File

@ -1023,8 +1023,15 @@ int eval_marks (WEdit * edit, long *start_mark, long *end_mark)
*start_mark = min (edit->mark1, edit->mark2);
*end_mark = max (edit->mark1, edit->mark2);
} else {
int diff;
*start_mark = min (edit->mark1, edit->curs1);
*end_mark = max (edit->mark1, edit->curs1);
diff = (*start_mark - edit_bol (edit, *start_mark)) -
(*end_mark - edit_bol (edit, *end_mark));
if (diff > 0) {
*start_mark -= diff;
*end_mark += diff;
}
edit->column2 = edit->curs_col + edit->over_col;
}
return 0;