In extend from point mode always restrict the top line to be from the point, even for multiline selections

Otherwise soft wrapped lines cause the full first line to be selected.
This commit is contained in:
Kovid Goyal 2021-05-23 15:52:48 +05:30
parent 76c9f46438
commit b702f3daf1
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -2696,7 +2696,7 @@ screen_update_selection(Screen *self, index_type x, index_type y, bool in_left_h
}
if (screen_selection_range_for_line(self, top_line, &start.x, &start.y) && screen_selection_range_for_line(self, bottom_line, &end.x, &end.y)) {
bool multiline = top_line != bottom_line;
if (!multiline && self->selections.extend_mode == EXTEND_LINE_FROM_POINT) {
if (self->selections.extend_mode == EXTEND_LINE_FROM_POINT) {
if (x > end.y) break;
a->x = x;
} else a->x = multiline ? 0 : start.x;